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:
parent
44c6bac2af
commit
cf7287d368
52
bochsrc
Normal file
52
bochsrc
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# configuration file generated by Bochs
|
||||||
|
plugin_ctrl: unmapped=1, biosdev=1, speaker=1, extfpuirq=1, gameport=1, pci_ide=1, acpi=1, ioapic=1
|
||||||
|
config_interface: textconfig
|
||||||
|
display_library: sdl
|
||||||
|
megs: 32
|
||||||
|
romimage: file="/usr/share/bochs/BIOS-bochs-latest"
|
||||||
|
vgaromimage: file="/usr/share/bochs/VGABIOS-lgpl-latest"
|
||||||
|
boot: cdrom
|
||||||
|
floppy_bootsig_check: disabled=0
|
||||||
|
# no floppya
|
||||||
|
# no floppyb
|
||||||
|
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
|
||||||
|
ata0-master: type=cdrom, path="hos.iso", status=inserted, biosdetect=auto, model="Generic 1234"
|
||||||
|
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
|
||||||
|
ata2: enabled=0
|
||||||
|
ata3: enabled=0
|
||||||
|
parport1: enabled=1, file=""
|
||||||
|
parport2: enabled=0
|
||||||
|
com1: enabled=1, mode=null, dev=""
|
||||||
|
com2: enabled=0
|
||||||
|
com3: enabled=0
|
||||||
|
com4: enabled=0
|
||||||
|
usb_uhci: enabled=0
|
||||||
|
usb_ohci: enabled=0
|
||||||
|
i440fxsupport: enabled=1
|
||||||
|
vga_update_interval: 50000
|
||||||
|
vga: extension=vbe
|
||||||
|
cpu: count=1, ips=4000000, reset_on_triple_fault=1, cpuid_limit_winnt=0
|
||||||
|
print_timestamps: enabled=0
|
||||||
|
# no gdb stub
|
||||||
|
port_e9_hack: enabled=0
|
||||||
|
text_snapshot_check: enabled=0
|
||||||
|
private_colormap: enabled=0
|
||||||
|
clock: sync=none, time0=local
|
||||||
|
# no cmosimage
|
||||||
|
ne2k: enabled=0
|
||||||
|
pnic: enabled=0
|
||||||
|
sb16: enabled=0
|
||||||
|
# no loader
|
||||||
|
log: -
|
||||||
|
logprefix: %t%e%d
|
||||||
|
panic: action=ask
|
||||||
|
error: action=report
|
||||||
|
info: action=report
|
||||||
|
debug: action=ignore
|
||||||
|
pass: action=fatal
|
||||||
|
keyboard_type: mf
|
||||||
|
keyboard_serial_delay: 250
|
||||||
|
keyboard_paste_delay: 100000
|
||||||
|
keyboard_mapping: enabled=0, map=
|
||||||
|
user_shortcut: keys=none
|
||||||
|
mouse: enabled=0, type=ps2
|
@ -26,8 +26,8 @@ $(KERNEL).gz: $(KERNEL)
|
|||||||
|
|
||||||
$(KERNEL): $(KERNEL).o
|
$(KERNEL): $(KERNEL).o
|
||||||
$(LD) $(LDFLAGS) -o $@ $<
|
$(LD) $(LDFLAGS) -o $@ $<
|
||||||
$(LD) $(LDFLAGS) --oformat=elf32-i386 -o $@.elf $<
|
$(OBJDUMP) --disassemble --source $@ > $@.dump
|
||||||
$(OBJDUMP) --disassemble --source $@.elf > $@.dump
|
strip $@
|
||||||
|
|
||||||
$(KERNEL).o: $(SUBDIRS)
|
$(KERNEL).o: $(SUBDIRS)
|
||||||
$(LD) -r -o $@ $(foreach subdir,$(SUBDIRS),$(subdir)/$(subdir)_all.o) $(LDLIBS)
|
$(LD) -r -o $@ $(foreach subdir,$(SUBDIRS),$(subdir)/$(subdir)_all.o) $(LDLIBS)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
; Adapted from HOS 0.16 source
|
; Adapted from HOS 0.16 source
|
||||||
|
|
||||||
%define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
%define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
||||||
%define MULTIBOOT_HEADER_FLAGS 0x00010003
|
%define MULTIBOOT_HEADER_FLAGS 0x00000003
|
||||||
|
|
||||||
%define VIRTUAL_OFFSET 0xE0000000 ; kernel virtual addr
|
%define VIRTUAL_OFFSET 0xE0000000 ; kernel virtual addr
|
||||||
%define CONSOLE_MEMORY 0xB8000
|
%define CONSOLE_MEMORY 0xB8000
|
||||||
@ -29,22 +29,6 @@ extern k_bootstrap, bootstrap_stack, mm_gdtr, k_main
|
|||||||
start:
|
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 *
|
;* Resume execution *
|
||||||
;**************************************************************************
|
;**************************************************************************
|
||||||
@ -56,6 +40,16 @@ multiboot_entry:
|
|||||||
jmp KERNEL_CODE_32_TMP_SEG:segmented_start
|
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 *
|
;* At this point address 0xE000_0000 is mapped to physical address 0x0 *
|
||||||
;**************************************************************************
|
;**************************************************************************
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
OUTPUT_FORMAT(binary)
|
OUTPUT_FORMAT(elf32-i386)
|
||||||
ENTRY(start)
|
ENTRY(start)
|
||||||
|
virt = 0xE0100000;
|
||||||
|
phys = 0x00100000;
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
.text 0xE0100000 : {
|
.text virt : AT(phys) {
|
||||||
code = .; _code = .; __code = .;
|
code = .; _code = .; __code = .;
|
||||||
*(.text*)
|
*(.text*)
|
||||||
*(.gnu.linkonce*)
|
*(.gnu.linkonce*)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user