From: Ben Gras Date: Tue, 22 Jun 2010 15:45:53 +0000 (+0000) Subject: boot: fix dosboot build and link to build. X-Git-Tag: v3.1.8~397 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch10.html?a=commitdiff_plain;h=d6af53bec039ed1adaef34ab816b689b12a11310;p=minix.git boot: fix dosboot build and link to build. --- diff --git a/boot/Makefile b/boot/Makefile index b4e100193..e2181ef2b 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -4,8 +4,8 @@ CC:=${CC:C/^gcc/cc/} COMPILER_TYPE:=ack -PROGS= bootblock cdbootblock bootexec boot masterboot \ - jumpboot installboot edparams +PROGS= bootblock cdbootblock boot masterboot \ + jumpboot installboot edparams dosboot mkfile SRCS.bootblock= bootblock.s CPPFLAGS.bootblock.s= ${I86CPPFLAGS} @@ -19,18 +19,15 @@ LDFLAGS.cdbootblock= ${I86LDFLAGS} BINDIR.cdbootblock= /usr/mdec MAN.cdbootblock= -SRCS.bootexec= boothead.s boot.c bootimage.c rawfs86.c +SRCS.boot= boothead.s boot.c bootimage.c rawfs86.c CPPFLAGS.boothead.s= ${I86CPPFLAGS} CPPFLAGS.boot.c= ${I86CPPFLAGS} CPPFLAGS.bootimage.c= ${I86CPPFLAGS} CPPFLAGS.rawfs86.c= ${I86CPPFLAGS} -LDFLAGS.bootexec= ${I86LDFLAGS} -DPADD.bootexec= ${LIBSYS} -LDADD.bootexec= -lsys -BINDIR.bootexec= /usr/mdec -MAN.bootexec= - -BINDIR.boot= /usr/mdec +LDFLAGS.boot= ${I86LDFLAGS} +DPADD.boot= ${LIBSYS} +LDADD.boot= -lsys +BINDIR.boot= /usr/mdec MAN.boot= SRCS.masterboot= masterboot.s @@ -54,18 +51,35 @@ CPPFLAGS.edparams.c= -DUNIX BINDIR.edparams= /usr/bin MAN.edparams= +SRCS.dosboot= doshead.s dosboot.o bootimage.o rawfs86.o +CPPFLAGS.dosboot.c= -DDOS $(I86CPPFLAGS) +LDADD.dosboot= ${I86LDFLAGS} -lsys +BINDIR.dosboot= /usr/mdec +CPPFLAGS.doshead.s= -mi386 +MAN.dosboot= + +SRCS.mkfile= mkfhead.s mkfile.c +CPPFLAGS.mkfile.s= ${I86CPPFLAGS} +LDADD.mkfile= ${I86LDFLAGS} -lsys +BINDIR.mkfile= /usr/mdec +MAN.mkfile= + rawfs86.c: rawfs.c ln -f rawfs.c rawfs86.c edparams.c: boot.c ln -f boot.c edparams.c +dosboot.c: boot.c + ln -f boot.c dosboot.c + cdbootblock.s: bootblock.s ln -f bootblock.s cdbootblock.s -boot: bootexec - install -S 22kb bootexec - cp bootexec boot +mkfile.com: mkfile + +boot.com: dosboot + ./a.out2com dosboot boot.com CPPFLAGS= -I${MINIXSRCDIR} AFLAGS= -I${MINIXSRCDIR} @@ -74,6 +88,6 @@ I86LDFLAGS= -mi86 -Was-ncc -.o -com STRIPFLAG= -s -CLEANFILES+= rawfs86.c edparams.c cdbootblock.s +CLEANFILES+= rawfs86.c edparams.c cdbootblock.s dosboot.c .include diff --git a/boot/boot.c b/boot/boot.c index f73ae45b6..ac42670a6 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -1472,6 +1472,11 @@ static void ctty(char *line) printf("No serial line support under DOS\n"); } +reset() +{ + printf("No reset support under DOS\n"); +} + #endif /* DOS */ #endif /* BIOS */ diff --git a/boot/bootimage.c b/boot/bootimage.c index 3638199b1..243c83a4a 100644 --- a/boot/bootimage.c +++ b/boot/bootimage.c @@ -767,8 +767,10 @@ char *select_image(char *image) ino_t image_ino; struct stat st; +#ifndef DOS image= strcpy(malloc((strlen(image) + 1 + NAME_MAX + 1) * sizeof(char)), image); +#endif fsok= r_super(&block_size) != 0; if (!fsok || (image_ino= r_lookup(ROOT_INO, image)) == 0) { diff --git a/boot/doshead.s b/boot/doshead.s index 8cd805786..74b7dd4fc 100644 --- a/boot/doshead.s +++ b/boot/doshead.s @@ -634,19 +634,19 @@ _dev_boundary: xor ax, ax ret -! int readsectors(u32_t bufaddr, u32_t sector, u8_t count) +! int biosreadsectors(u32_t bufaddr, u32_t sector, u8_t count) ! int writesectors(u32_t bufaddr, u32_t sector, u8_t count) ! Read/write several sectors from/to the Minix virtual disk. Count ! must fit in a byte. The external variable vfd is the file handle. ! Returns 0 for success, otherwise the DOS error code. ! -.define _readsectors, _writesectors +.define _biosreadsectors, _writesectors _writesectors: push bp mov bp, sp movb 13(bp), 0x40 ! Code for a file write jmp rwsec -_readsectors: +_biosreadsectors: push bp mov bp, sp movb 13(bp), 0x3F ! Code for a file read