+ Changes Lucho

* boot.asm, boot32.asm, boot32lb.asm, sys.c: add metakern support:
      sys looks for a file metakern.sys which is a multiple of 512.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@702 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2003-09-21 16:13:16 +00:00
parent c4e02e8654
commit c669f3644c
4 changed files with 27 additions and 16 deletions

View File

@ -519,9 +519,8 @@ read_ok:
pop si pop si
ret ret
filename db "KERNEL SYS" times 0x01f1-$+$$ db 0
filename db "KERNEL SYS",0,0
times 0x01fe-$+$$ db 0
sign dw 0xAA55 sign dw 0xAA55

View File

@ -384,8 +384,8 @@ no_incr_es:
adc dx,byte 0 adc dx,byte 0
ret ret
filename db "KERNEL SYS" times 0x01f1-$+$$ db 0
times 0x01fe-$+$$ db 0 filename db "KERNEL SYS",0,0
sign dw 0xAA55 sign dw 0xAA55

View File

@ -388,18 +388,17 @@ no_incr_es: pop di
;----------------------------------------------------------------------- ;-----------------------------------------------------------------------
msg_LoadFreeDOS db "Loading FreeDOS ",0 msg_LoadFreeDOS db "Loading FreeDOS ",0
mystack dw 0x7c00 ; the 0 for SS overlaps into pad bytes!
; (so we can LSS SP to 0:7c00)
times 0x01ee-$+$$ db 0
msg_BootError db "No " msg_BootError db "No "
; currently, only "kernel.sys not found" gives a message, ; currently, only "kernel.sys not found" gives a message,
; but read errors in data or root or fat sectors do not. ; but read errors in data or root or fat sectors do not.
filename db "KERNEL SYS" filename db "KERNEL SYS"
msg_BootErrorPart2:
db " ???",0
times 0x01fa-$+$$ db 0
mystack dw 0x7c00 ; the 0 for SS overlaps into sign!
; (so we can LSS SP to 0:7c00)
sign dw 0, 0xAA55 sign dw 0, 0xAA55
; Win9x uses all 4 bytes as magic value here. ; Win9x uses all 4 bytes as magic value here.

View File

@ -29,7 +29,7 @@
#define DEBUG #define DEBUG
/* #define DDEBUG */ /* #define DDEBUG */
#define SYS_VERSION "v2.7" #define SYS_VERSION "v2.8"
#include <stdlib.h> #include <stdlib.h>
#include <dos.h> #include <dos.h>
@ -111,9 +111,10 @@ int write(int fd, const void *buf, unsigned count)
int stat(const char *file_name, struct stat *buf) int stat(const char *file_name, struct stat *buf)
{ {
struct find_t find_tbuf; struct find_t find_tbuf;
UNREFERENCED_PARAMETER(buf); int ret = _dos_findfirst(file_name, _A_NORMAL | _A_HIDDEN | _A_SYSTEM, &find_tbuf);
if (!ret)
return _dos_findfirst(file_name, _A_NORMAL | _A_HIDDEN | _A_SYSTEM, &find_tbuf); buf->st_size = find_tbuf.size;
return ret;
} }
/* WATCOM's getenv is case-insensitive which wastes a lot of space /* WATCOM's getenv is case-insensitive which wastes a lot of space
@ -726,6 +727,18 @@ VOID put_boot(COUNT drive, BYTE * bsFile, BOOL both)
printf("Root directory starts at sector (PREVIOUS + %u * %u)\n", printf("Root directory starts at sector (PREVIOUS + %u * %u)\n",
bs->bsFATsecs, bs->bsFATs); bs->bsFATsecs, bs->bsFATs);
#endif #endif
{
struct stat sbuf;
static char metakern[] = "A:\\METAKERN.SYS";
metakern[0] = drive + 'A';
if (!stat(metakern, &sbuf) && sbuf.st_size && !(sbuf.st_size & SEC_SIZE-1))
{
memcpy(&newboot[0x1f1], "METAKERNSYS", 11);
#ifdef DEBUG
printf("%s found - boot sector patched to load it!\n", metakern);
#endif
}
}
#ifdef DDEBUG #ifdef DDEBUG
printf("\nNew Boot Sector:\n"); printf("\nNew Boot Sector:\n");