removed multiboot kludge; using ELF kernel with different virtual and load addresses
git-svn-id: svn://anubis/hos/trunk@71 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
1 parent
44c6bac2af
commit
cf7287d368
4 files changed
+69
-21
No files matched your search
+2
-2
@@ -26,8 +26,8 @@ $(KERNEL).gz: $(KERNEL)
|
||||
|
||||
$(KERNEL): $(KERNEL).o
|
||||
$(LD) $(LDFLAGS) -o $@ $<
|
||||
$(LD) $(LDFLAGS) --oformat=elf32-i386 -o $@.elf $<
|
||||
$(OBJDUMP) --disassemble --source $@.elf > $@.dump
|
||||
$(OBJDUMP) --disassemble --source $@ > $@.dump
|
||||
strip $@
|
||||
|
||||
$(KERNEL).o: $(SUBDIRS)
|
||||
$(LD) -r -o $@ $(foreach subdir,$(SUBDIRS),$(subdir)/$(subdir)_all.o) $(LDLIBS)
|
||||
|
||||
+11
-17
@@ -5,7 +5,7 @@
|
||||
; Adapted from HOS 0.16 source
|
||||
|
||||
%define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
||||
%define MULTIBOOT_HEADER_FLAGS 0x00010003
|
||||
%define MULTIBOOT_HEADER_FLAGS 0x00000003
|
||||
|
||||
%define VIRTUAL_OFFSET 0xE0000000 ; kernel virtual addr
|
||||
%define CONSOLE_MEMORY 0xB8000
|
||||
@@ -29,22 +29,6 @@ extern k_bootstrap, bootstrap_stack, mm_gdtr, k_main
|
||||
start:
|
||||
|
||||
|
||||
;**************************************************************************
|
||||
;* Multiboot header data block *
|
||||
;**************************************************************************
|
||||
align 4
|
||||
multiboot_header:
|
||||
dd MULTIBOOT_HEADER_MAGIC ; magic
|
||||
dd MULTIBOOT_HEADER_FLAGS ; flags
|
||||
dd -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) ; checksum
|
||||
|
||||
dd multiboot_header - VIRTUAL_OFFSET ; header_addr
|
||||
dd start - VIRTUAL_OFFSET ; load_addr
|
||||
dd _bss - VIRTUAL_OFFSET ; load_end_addr
|
||||
dd _end - VIRTUAL_OFFSET ; bss_end_addr
|
||||
dd multiboot_entry - VIRTUAL_OFFSET ; entry_addr
|
||||
|
||||
|
||||
;**************************************************************************
|
||||
;* Resume execution *
|
||||
;**************************************************************************
|
||||
@@ -56,6 +40,16 @@ multiboot_entry:
|
||||
jmp KERNEL_CODE_32_TMP_SEG:segmented_start
|
||||
|
||||
|
||||
;**************************************************************************
|
||||
;* Multiboot header data block *
|
||||
;**************************************************************************
|
||||
align 4
|
||||
multiboot_header:
|
||||
dd MULTIBOOT_HEADER_MAGIC ; magic
|
||||
dd MULTIBOOT_HEADER_FLAGS ; flags
|
||||
dd -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) ; checksum
|
||||
|
||||
|
||||
;**************************************************************************
|
||||
;* At this point address 0xE000_0000 is mapped to physical address 0x0 *
|
||||
;**************************************************************************
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
OUTPUT_FORMAT(binary)
|
||||
OUTPUT_FORMAT(elf32-i386)
|
||||
ENTRY(start)
|
||||
virt = 0xE0100000;
|
||||
phys = 0x00100000;
|
||||
SECTIONS
|
||||
{
|
||||
.text 0xE0100000 : {
|
||||
.text virt : AT(phys) {
|
||||
code = .; _code = .; __code = .;
|
||||
*(.text*)
|
||||
*(.gnu.linkonce*)
|
||||
|
||||
Reference in new issue
Block a user