mirror of
https://github.com/FDOS/kernel.git
synced 2025-04-08 17:15:17 +02:00
+ 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:
parent
c4e02e8654
commit
c669f3644c
@ -519,9 +519,8 @@ read_ok:
|
||||
pop si
|
||||
ret
|
||||
|
||||
filename db "KERNEL SYS"
|
||||
times 0x01f1-$+$$ db 0
|
||||
|
||||
|
||||
times 0x01fe-$+$$ db 0
|
||||
filename db "KERNEL SYS",0,0
|
||||
|
||||
sign dw 0xAA55
|
||||
|
@ -384,8 +384,8 @@ no_incr_es:
|
||||
adc dx,byte 0
|
||||
ret
|
||||
|
||||
filename db "KERNEL SYS"
|
||||
times 0x01f1-$+$$ db 0
|
||||
|
||||
times 0x01fe-$+$$ db 0
|
||||
filename db "KERNEL SYS",0,0
|
||||
|
||||
sign dw 0xAA55
|
||||
|
@ -388,18 +388,17 @@ no_incr_es: pop di
|
||||
;-----------------------------------------------------------------------
|
||||
|
||||
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 "
|
||||
; 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"
|
||||
|
||||
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
|
||||
; Win9x uses all 4 bytes as magic value here.
|
||||
|
21
sys/sys.c
21
sys/sys.c
@ -29,7 +29,7 @@
|
||||
#define DEBUG
|
||||
/* #define DDEBUG */
|
||||
|
||||
#define SYS_VERSION "v2.7"
|
||||
#define SYS_VERSION "v2.8"
|
||||
|
||||
#include <stdlib.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)
|
||||
{
|
||||
struct find_t find_tbuf;
|
||||
UNREFERENCED_PARAMETER(buf);
|
||||
|
||||
return _dos_findfirst(file_name, _A_NORMAL | _A_HIDDEN | _A_SYSTEM, &find_tbuf);
|
||||
int ret = _dos_findfirst(file_name, _A_NORMAL | _A_HIDDEN | _A_SYSTEM, &find_tbuf);
|
||||
if (!ret)
|
||||
buf->st_size = find_tbuf.size;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 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",
|
||||
bs->bsFATsecs, bs->bsFATs);
|
||||
#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
|
||||
printf("\nNew Boot Sector:\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user