From cfed8c6f290baf167429d2c3c71f8b158c2c88de Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Fri, 9 Apr 2004 23:51:44 +0000 Subject: [PATCH] We must do "sbb ax, ax" *before* "popf" otherwise it won't be predictable! git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@856 6ac86273-5f31-0410-b378-82cca8765d1b --- sys/sys.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/sys.c b/sys/sys.c index a145f27..ee402fe 100644 --- a/sys/sys.c +++ b/sys/sys.c @@ -29,7 +29,7 @@ #define DEBUG /* #define DDEBUG */ -#define SYS_VERSION "v3.1" +#define SYS_VERSION "v3.2" #include #include @@ -437,9 +437,9 @@ int absread(int DosDrive, int nsects, int foo, void *diskReadPacket); #pragma aux absread = \ "push bp" \ "int 0x25" \ + "sbb ax, ax" \ "popf" \ "pop bp" \ - "sbb ax, ax" \ parm [ax] [cx] [dx] [bx] \ modify [si di] \ value [ax]; @@ -448,9 +448,9 @@ int abswrite(int DosDrive, int nsects, int foo, void *diskReadPacket); #pragma aux abswrite = \ "push bp" \ "int 0x26" \ + "sbb ax, ax" \ "popf" \ "pop bp" \ - "sbb ax, ax" \ parm [ax] [cx] [dx] [bx] \ modify [si di] \ value [ax]; @@ -709,6 +709,13 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both bs = (struct bootsectortype *)&oldboot; + if (bs->bsBytesPerSec != SEC_SIZE) + { + printf("Sector size is not 512 but %d bytes - not currently supported!\n", + bs->bsBytesPerSec); + exit(1); /* Japan?! */ + } + { /* see "FAT: General Overview of On-Disk Format" v1.02, 5.V.1999 * (http://www.nondot.org/sabre/os/files/FileSystems/FatFormat.pdf) @@ -733,13 +740,6 @@ void put_boot(int drive, char *bsFile, char *kernel_name, int load_seg, int both fs = FAT32; } - if (bs->bsBytesPerSec != SEC_SIZE) - { - printf("Sector size is not 512 but %d bytes - not currently supported!\n", - bs->bsBytesPerSec); - exit(1); /* Japan?! */ - } - /* bit 0 set if function to use current BPB, clear if Device BIOS Parameter Block field contains new default BPB bit 1 set if function to use track layout fields only