diff options
| author | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2010-01-15 11:26:20 +0000 |
|---|---|---|
| committer | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2010-01-15 11:26:20 +0000 |
| commit | cf8398526359cf892db26ecb2bf7074aa2222b27 (patch) | |
| tree | f74fa80905ad4e609e8c81203477b54bd67406ea /sys/boot/common | |
| parent | ad9bb0898d7d8f037e2642af4a1ab960440f7f48 (diff) | |
Notes
Diffstat (limited to 'sys/boot/common')
| -rw-r--r-- | sys/boot/common/module.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c index 098e39ad938b..18ba1b550e21 100644 --- a/sys/boot/common/module.c +++ b/sys/boot/common/module.c @@ -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; |
