Hi!

- small sys.c optimizations.

--- Begin Message ---
diff -ruNp old/boot/boot.asm new/boot/boot.asm
--- old/boot/boot.asm   2004-01-25 16:40:18.000000000 +0000
+++ new/boot/boot.asm   2004-06-20 10:07:36.000000000 +0000
@@ -64,6 +64,7 @@ Entry:          jmp     short real_start
 
 ;       bp is initialized to 7c00h
 %define bsOemName       bp+0x03      ; OEM label
+                       db "FreeDOS "
 %define bsBytesPerSec   bp+0x0b      ; bytes/sector
 %define bsSecPerClust   bp+0x0d      ; sectors/allocation unit
 %define bsResSectors    bp+0x0e      ; # reserved sectors
@@ -520,8 +521,10 @@ read_ok:
                 pop     si
                 ret
 
-       times   0x01f1-$+$$ db 0
+;------------------------------------------------------------------------
 
-filename        db      "KERNEL  SYS",0,0
+       times 0x01f1-$+$$ db 0
 
-sign            dw      0xAA55
+filename:
+       times 11 db ' '         ; db "KERNEL  SYS"
+               dw 0,0xAA55     ; signature: Win9x uses all 4 bytes here
diff -ruNp old/boot/boot32.asm new/boot/boot32.asm
--- old/boot/boot32.asm 2004-01-25 16:40:18.000000000 +0000
+++ new/boot/boot32.asm 2004-06-20 10:07:34.000000000 +0000
@@ -41,6 +41,7 @@ Entry:          jmp     short real_start
 
 ;       bp is initialized to 7c00h
 %define bsOemName       bp+0x03      ; OEM label
+                       db "FreeDOS "
 %define bsBytesPerSec   bp+0x0b      ; bytes/sector
 %define bsSecPerClust   bp+0x0d      ; sectors/allocation unit
 %define bsResSectors    bp+0x0e      ; # reserved sectors
@@ -385,8 +386,10 @@ no_incr_es:
                 adc     dx,byte 0
                 ret
 
-       times   0x01f1-$+$$ db 0
+;------------------------------------------------------------------------
 
-filename        db      "KERNEL  SYS",0,0
+       times 0x01f1-$+$$ db 0
 
-sign            dw      0xAA55
+filename:
+       times 11 db ' '         ; db "KERNEL  SYS"
+               dw 0,0xAA55     ; signature: Win9x uses all 4 bytes here
diff -ruNp old/boot/boot32lb.asm new/boot/boot32lb.asm
--- old/boot/boot32lb.asm       2004-01-25 16:40:18.000000000 +0000
+++ new/boot/boot32lb.asm       2004-06-20 10:07:18.000000000 +0000
@@ -58,6 +58,7 @@ Entry:                jmp     short real_start
 
 ;      bp is initialized to 7c00h
 ; %define bsOemName    bp+0x03 ; OEM label (8)
+                       db "FreeDOS "
 %define bsBytesPerSec  bp+0x0b ; bytes/sector (dw)
 %define bsSecPerClust  bp+0x0d ; sectors/allocation unit (db)
 %define bsResSectors   bp+0x0e ; # reserved sectors (dw)
@@ -387,17 +388,16 @@ no_incr_es:       pop     di
                pop     dx
                ret
 
-;-----------------------------------------------------------------------
+;------------------------------------------------------------------------
 
 msg_LoadFreeDOS db "Loading FreeDOS ",0
 
-       times 0x01ee-$+$$ db 0
+       times 0x01ee-$+$$ db 0
 
 msg_BootError  db "No "
                ; currently, only "kernel.sys not found" gives a message,
                ; but read errors in data or root or fat sectors do not.
 
-filename       db "KERNEL  SYS"
-
-sign           dw 0, 0xAA55
-               ; Win9x uses all 4 bytes as magic value here.
+filename:
+       times 11 db ' '         ; db "KERNEL  SYS"
+               dw 0,0xAA55     ; signature: Win9x uses all 4 bytes here
diff -ruNp old/sys/sys.c new/sys/sys.c
--- old/sys/sys.c       2004-04-09 16:51:24.000000000 +0000
+++ new/sys/sys.c       2004-06-20 10:12:08.000000000 +0000
@@ -782,8 +782,6 @@ void put_boot(int drive, char *bsFile, c
 
   bs = (struct bootsectortype *)&newboot;
 
-  memcpy(bs->OemName, "FreeDOS ", 8);
-
 #ifdef WITHFAT32
   if (fs == FAT32)
   {
@@ -819,7 +817,6 @@ void put_boot(int drive, char *bsFile, c
 #endif
   {
     int i = 0;
-    memset(&newboot[0x1f1], ' ', 11);
     while (kernel_name[i] && kernel_name[i] != '.')
     {
       if (i < 8)

--- End Message ---

Reply via email to