From fb5fbfc7506d016ab99e200d10dfe2a433e782be Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 1 May 2003 03:56:30 +0000 Subject: Enable the i386 loader to load and run an amd64 kernel. If this puts things over floppy size limits, I can exclude it for release builds or something like that. Most of the changes are to get the load_elf.c file into a seperate elf32_ or elf64_ namespace so that you can have two ELF loaders present at once. Note that for 64 bit kernels, it actually starts up the kernel already in 64 bit mode with paging enabled. This is really easy because we have a known minimum feature set. Of note is that for amd64, we have to pass in the bios int 15 0xe821 memory map because once in long mode, you absolutely cannot make VM86 calls. amd64 does not use 'struct bootinfo' at all. It is a pure loader metadata startup, just like sparc64 and powerpc. Much of the infrastructure to support this was adapted from sparc64. --- sys/boot/ia64/common/exec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/boot/ia64/common') diff --git a/sys/boot/ia64/common/exec.c b/sys/boot/ia64/common/exec.c index 7df9950..27d2b6e 100644 --- a/sys/boot/ia64/common/exec.c +++ b/sys/boot/ia64/common/exec.c @@ -94,9 +94,9 @@ #define _KERNEL -static int elf_exec(struct preloaded_file *amp); +static int elf64_exec(struct preloaded_file *amp); -struct file_format ia64_elf = { elf_loadfile, elf_exec }; +struct file_format ia64_elf = { elf64_loadfile, elf64_exec }; static __inline u_int64_t disable_ic() @@ -136,7 +136,7 @@ enter_kernel(u_int64_t start, struct bootinfo *bi) } static int -elf_exec(struct preloaded_file *fp) +elf64_exec(struct preloaded_file *fp) { struct file_metadata *md; Elf_Ehdr *hdr; -- cgit v1.1