Compare commits
2 Commits
94e5e70305
...
0d16e3e35a
Author | SHA1 | Date |
---|---|---|
Eric-Paul Ickhorn | 0d16e3e35a | |
Eric-Paul Ickhorn | 6e8e022937 |
|
@ -26,13 +26,41 @@ setup_drivers:
|
||||||
mov [esi + (64 - 16)], edx
|
mov [esi + (64 - 16)], edx
|
||||||
mov [esi + (64 - 20)], edi
|
mov [esi + (64 - 20)], edi
|
||||||
|
|
||||||
|
; [esi + 8]: Pointer to the current driver init function
|
||||||
|
; [esi + 12]L Pointer to current driver slot
|
||||||
|
; ecx: Driver slot index
|
||||||
|
|
||||||
|
xor ecx, ecx
|
||||||
|
|
||||||
|
.driver_setup_loop:
|
||||||
|
cmp ecx, DRIVER_SLOT_COUNT
|
||||||
|
jae .epilog
|
||||||
|
|
||||||
|
mov ebx, ecx
|
||||||
|
shl ebx, 2
|
||||||
|
add ebx, driver_init_functions
|
||||||
|
mov eax, [ebx]
|
||||||
|
mov [esi + 8], eax
|
||||||
|
|
||||||
|
cmp eax, 0
|
||||||
|
je .epilog
|
||||||
|
|
||||||
|
mov eax, ecx
|
||||||
|
mov edx, DRIVER_SLOT_SIZE
|
||||||
|
mul edx
|
||||||
|
mov [esi + 12], eax
|
||||||
|
|
||||||
push ebp
|
push ebp
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
push dword DRIVER_MEMORY_AREA
|
push dword [esi + 12]
|
||||||
call initialize_pci_driver
|
mov eax, [esi + 8]
|
||||||
|
call eax
|
||||||
mov esp, ebp
|
mov esp, ebp
|
||||||
pop ebp
|
pop ebp
|
||||||
|
|
||||||
|
inc ecx
|
||||||
|
jmp .driver_setup_loop
|
||||||
|
|
||||||
.epilog:
|
.epilog:
|
||||||
mov eax, [esi + (64 - 4)]
|
mov eax, [esi + (64 - 4)]
|
||||||
mov ebx, [esi + (64 - 8)]
|
mov ebx, [esi + (64 - 8)]
|
||||||
|
@ -45,3 +73,4 @@ setup_drivers:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
%include "drivers/pci/driver.asm"
|
%include "drivers/pci/driver.asm"
|
||||||
|
%include "drivers/acpi/driver.asm"
|
||||||
|
|
|
@ -46,9 +46,6 @@ stage_2_setup_entry:
|
||||||
cli
|
cli
|
||||||
hlt
|
hlt
|
||||||
|
|
||||||
some_text:
|
|
||||||
db "This is some text.", 0x00
|
|
||||||
|
|
||||||
; Utilities
|
; Utilities
|
||||||
; Memory Management
|
; Memory Management
|
||||||
%include "memory/a20.asm"
|
%include "memory/a20.asm"
|
||||||
|
@ -58,13 +55,18 @@ some_text:
|
||||||
|
|
||||||
bits 32
|
bits 32
|
||||||
stage2_true_entry:
|
stage2_true_entry:
|
||||||
mov [dword 0xb8000], byte 'X'
|
push ebp
|
||||||
mov [dword 0xb8000 + 1], byte 0x31
|
mov ebp, esp
|
||||||
|
call setup_drivers
|
||||||
|
mov esp, ebp
|
||||||
|
pop ebp
|
||||||
|
|
||||||
cli
|
cli
|
||||||
hlt
|
hlt
|
||||||
|
|
||||||
%include "utility/math.asm"
|
%include "utility/math.asm"
|
||||||
%include "utility/memory.asm"
|
%include "utility/memory.asm"
|
||||||
|
%include "utility/display.asm"
|
||||||
|
|
||||||
; Driver Manager
|
; Driver Manager
|
||||||
; %include "drivers/manager.asm"
|
%include "drivers/manager.asm"
|
||||||
|
|
Loading…
Reference in New Issue