Don't use 15M-16M area on pc98. It's reserved for some devices.
MFC after: 2 week
This commit is contained in:
parent
6925b4bda1
commit
5c44b2a6b3
@ -351,6 +351,9 @@ file_loadraw(char *type, char *name)
|
||||
char *cp;
|
||||
int fd, got;
|
||||
vm_offset_t laddr;
|
||||
#ifdef PC98
|
||||
struct stat st;
|
||||
#endif
|
||||
|
||||
/* We can't load first */
|
||||
if ((file_findfile(NULL, NULL)) == NULL) {
|
||||
@ -372,6 +375,14 @@ file_loadraw(char *type, char *name)
|
||||
return(CMD_ERROR);
|
||||
}
|
||||
|
||||
#ifdef PC98
|
||||
/* We cannot use 15M-16M area on pc98. */
|
||||
if (loadaddr < 0x1000000 &&
|
||||
fstat(fd, &st) == 0 &&
|
||||
(st.st_size == -1 || loadaddr + st.st_size > 0xf00000))
|
||||
loadaddr = 0x1000000;
|
||||
#endif
|
||||
|
||||
laddr = loadaddr;
|
||||
for (;;) {
|
||||
/* read in 4k chunks; size is not really important */
|
||||
@ -477,6 +488,14 @@ mod_loadkld(const char *kldname, int argc, char *argv[])
|
||||
;
|
||||
|
||||
do {
|
||||
#ifdef PC98
|
||||
/* We cannot use 15M-16M area on pc98. */
|
||||
struct stat st;
|
||||
if (loadaddr < 0x1000000 &&
|
||||
stat(filename, &st) == 0 &&
|
||||
(st.st_size == -1 || loadaddr + st.st_size > 0xf00000))
|
||||
loadaddr = 0x1000000;
|
||||
#endif
|
||||
err = file_load(filename, loadaddr, &fp);
|
||||
if (err)
|
||||
break;
|
||||
|
@ -7,7 +7,7 @@ BINDIR?= /boot
|
||||
LOADER_ADDRESS?=0x200000
|
||||
CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \
|
||||
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
|
||||
-Os
|
||||
-Os -DPC98
|
||||
LDFLAGS+= -nostdlib
|
||||
|
||||
# BTX components
|
||||
|
Loading…
Reference in New Issue
Block a user