Minor changes for parity

This commit is contained in:
Curle 2019-06-22 18:54:21 +01:00
parent a1c00187c4
commit 1ae4339d7a
4 changed files with 63 additions and 66 deletions

View File

@ -1,42 +1,39 @@
MBOOT_ALIGN equ 1<<0
MBOOT_MEMINFO equ 1<<1
MBOOT_FLAGS equ MBOOT_ALIGN | MBOOT_MEMINFO
MBOOT_MAGIC equ 0x1BADB002
MBOOT_CHECKSUM equ -(MBOOT_MAGIC + MBOOT_FLAGS)
[BITS 32] [BITS 32]
[GLOBAL mboot] [GLOBAL start]
[SECTION .multiboot] start:
mov esp, _sys_stack
jmp stublet
ALIGN 4 ALIGN 4
mboot: mboot:
dd MBOOT_MAGIC MULTIBOOT_ALIGN equ 1<<0
dd MBOOT_FLAGS MULTIBOOT_MEM equ 1<<1
dd MBOOT_CHECKSUM MULTIBOOT_AOUT equ 1<<16
MULTIBOOT_MAGIC equ 0x1BADB002
MULTIBOOT_FLAGS equ MULTIBOOT_ALIGN | MULTIBOOT_MEM | MULTIBOOT_AOUT
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_MAGIC + MULTIBOOT_FLAGS)
EXTERN code, bss, end
SECTION .bss dd MULTIBOOT_MAGIC
ALIGN 16 dd MULTIBOOT_FLAGS
stack_bottom: dd MULTIBOOT_CHECKSUM
RESB 16384
stack_top:
dd mboot
dd code
dd bss
dd end
dd start
SECTION .text stublet:
[GLOBAL _start] EXTERN kernel_main
[EXTERN kernel_main]
_start:
push ebx
cli
call kernel_main call kernel_main
jmp $ jmp $
[GLOBAL load_gdt] ; Allows the C code to call gdt_flush(). [GLOBAL load_gdt] ; Allows the C code to call gdt_flush().
[EXTERN gp]
load_gdt: load_gdt:
mov eax, [esp+4] ; Get the pointer to the GDT, passed as a parameter. lgdt [gp] ; Load the new GDT pointer
lgdt [eax] ; Load the new GDT pointer
mov ax, 0x10 ; 0x10 is the offset in the GDT to our data segment mov ax, 0x10 ; 0x10 is the offset in the GDT to our data segment
mov ds, ax ; Load all data segment selectors mov ds, ax ; Load all data segment selectors
@ -184,3 +181,6 @@ idt_load:
lidt [eax] lidt [eax]
ret ret
SECTION .bss
resb 8192
_sys_stack:

View File

@ -1,31 +1,25 @@
OUTPUT_FORMAT("binary")
ENTRY(_start) ENTRY(start)
phys = 0x00100000;
SECTIONS SECTIONS
{ {
.text phys : AT(phys) {
. = 1M; code = .;
*(.text)
.text BLOCK(4K) : ALIGN(4K) *(.rodata)
{ . = ALIGN(4096);
*(.multiboot)
*(.text)
} }
.data : AT(phys + (data - code))
.rodata BLOCK(4K) : ALIGN(4K)
{ {
*(.rodata) data = .;
*(.data)
. = ALIGN(4096);
} }
.bss : AT(phys + (bss - code))
.data BLOCK(4K) : ALIGN(4K)
{ {
*(.data) bss = .;
*(.bss)
. = ALIGN(4096);
} }
end = .;
.bss BLOCK(4K) : ALIGN(4K) }
{
*(COMMON)
*(.bss)
}
}

View File

@ -3,18 +3,14 @@ plugin_ctrl: unmapped=1, biosdev=1, speaker=1, extfpuirq=1, parallel=1, serial=1
config_interface: textconfig config_interface: textconfig
display_library: x display_library: x
memory: host=32, guest=32 memory: host=32, guest=32
romimage: file="/usr/share/bochs/BIOS-bochs-latest", options=none romimage: file="/usr/share/bochs/BIOS-bochs-latest", address=0x0, options=none
vgaromimage: file="/usr/share/bochs/VGABIOS-lgpl-latest" vgaromimage: file="/usr/share/bochs/VGABIOS-lgpl-latest"
boot: floppy boot: a
floppy_bootsig_check: disabled=0 floppy_bootsig_check: disabled=1
#floppya: 1_44=red.img, status=inserted floppya: 1_44=/dev/loop0, status=inserted
# no floppyb # no floppyb
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 ata0: enabled=0
ata0-master: type=cdrom, path=red.iso, status=inserted ata1: enabled=0
ata0-slave: type=none
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata1-master: type=none
ata1-slave: type=none
ata2: enabled=0 ata2: enabled=0
ata3: enabled=0 ata3: enabled=0
optromimage1: file=none optromimage1: file=none
@ -27,20 +23,20 @@ optramimage3: file=none
optramimage4: file=none optramimage4: file=none
pci: enabled=1, chipset=i440fx pci: enabled=1, chipset=i440fx
vga: extension=vbe, update_freq=5, realtime=1 vga: extension=vbe, update_freq=5, realtime=1
cpu: count=1:1:1, ips=4000000, quantum=16, model=bx_generic, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1, mwait_is_nop=0 cpu: count=1:1:1, ips=1000000, quantum=16, model=bx_generic, reset_on_triple_fault=0, cpuid_limit_winnt=0, ignore_bad_msrs=1, mwait_is_nop=0
cpuid: level=6, stepping=3, model=3, family=6, vendor_string="AuthenticAMD", brand_string="AMD Athlon(tm) processor" cpuid: level=6, stepping=3, model=3, family=6, vendor_string="AuthenticAMD", brand_string="AMD Athlon(tm) processor"
cpuid: mmx=1, apic=xapic, simd=sse2, sse4a=0, misaligned_sse=0, sep=1, movbe=0, adx=0 cpuid: mmx=1, apic=xapic, simd=sse2, sse4a=0, misaligned_sse=0, sep=1, movbe=0, adx=0
cpuid: aes=0, sha=0, xsave=0, xsaveopt=0, avx_f16c=0, avx_fma=0, bmi=0, xop=0, fma4=0 cpuid: aes=0, sha=0, xsave=0, xsaveopt=0, avx_f16c=0, avx_fma=0, bmi=0, xop=0, fma4=0
cpuid: tbm=0, x86_64=1, 1g_pages=0, pcid=0, fsgsbase=0, smep=0, smap=0, mwait=1 cpuid: tbm=0, x86_64=1, 1g_pages=0, pcid=0, fsgsbase=0, smep=0, smap=0, mwait=1
print_timestamps: enabled=0 print_timestamps: enabled=0
debugger_log: - debugger_log: ../red.debug
magic_break: enabled=0 magic_break: enabled=1
port_e9_hack: enabled=0 port_e9_hack: enabled=0
private_colormap: enabled=0 private_colormap: enabled=0
clock: sync=none, time0=local, rtc_sync=0 clock: sync=none, time0=local, rtc_sync=0
# no cmosimage # no cmosimage
# no loader # no loader
log: - log: ../red.log
logprefix: %t%e%d logprefix: %t%e%d
debug: action=ignore debug: action=ignore
info: action=report info: action=report

7
iso/boot/grub/grub.cfg Normal file
View File

@ -0,0 +1,7 @@
set timeout=10
set default=0
menuentry "ProjectRED" {
multiboot /boot/red.kernel
boot
}