Compare commits
No commits in common. "f0fcefc5ebd5095deb15d3d3df162b561b3f7854" and "916d7bd030ed7217d84e249fda1e1608fa4777f0" have entirely different histories.
f0fcefc5eb
...
916d7bd030
|
@ -1,45 +0,0 @@
|
||||||
# i386 Nightloader | Folder Structure
|
|
||||||
|
|
||||||
## Legacy BIOS bootsector (bootsector/)
|
|
||||||
|
|
||||||
Contains one file, the source of the bootsector. This assembly program
|
|
||||||
must span the first 512 byte of a legacy Nightloader-booted Partition.
|
|
||||||
|
|
||||||
## Legacy BIOS Edition (legacy-boot/)
|
|
||||||
|
|
||||||
This edition of the Nightloader is made for older devices that predate
|
|
||||||
UEFI (or potentially for devices that have unreliable UEFI-support).
|
|
||||||
|
|
||||||
This folder contains the assembly sources to create the loader
|
|
||||||
partition which contains raw machine code that is loaded by the
|
|
||||||
bootsector and to which the control is handed thereafter.
|
|
||||||
|
|
||||||
### Source Folder Structure
|
|
||||||
|
|
||||||
#### drivers/
|
|
||||||
|
|
||||||
- acpi
|
|
||||||
Driver for the Avanced Control and Power Interface.
|
|
||||||
- pci
|
|
||||||
Driver for the Peripheral Component Interconnect. This is used to
|
|
||||||
first find and then interact with the builtin devices in a computer,
|
|
||||||
mostly storage devices, but also network cards, USB keyboards, etc..
|
|
||||||
- ahci
|
|
||||||
Driver for AHCI, the ATA Host Controller Interface (ATA meaning
|
|
||||||
(IBM PC) AT Attachment), storage interface. This is used to interact
|
|
||||||
with practically every modern consumer SSD and HDD. Older HDDs might
|
|
||||||
use another interface, but that's not of elevated relevance.
|
|
||||||
|
|
||||||
|
|
||||||
#### memory/
|
|
||||||
|
|
||||||
Memory Management functions, A20 line check, GDT setup and, some day
|
|
||||||
in the future, paging for add-ons execution. This also contains utils
|
|
||||||
like the allocators (arena, pool) used throughout the bootloader.
|
|
||||||
|
|
||||||
#### utility/
|
|
||||||
|
|
||||||
Helper functions that make it easier to write the other functionality
|
|
||||||
but don't fall into any of the other categories on their own.
|
|
||||||
|
|
||||||
## Documentation (docs/)
|
|
|
@ -53,7 +53,7 @@ acpi_enumerate_tables:
|
||||||
mov ebx, [esi + 8]
|
mov ebx, [esi + 8]
|
||||||
add ebx, eax
|
add ebx, eax
|
||||||
|
|
||||||
mov eax, [ebx]
|
mov eax, [ebx]Z
|
||||||
|
|
||||||
inc ecx
|
inc ecx
|
||||||
jmp .enumeration_loop
|
jmp .enumeration_loop
|
||||||
|
@ -97,7 +97,7 @@ acpi_search_rsdt:
|
||||||
pop ebp
|
pop ebp
|
||||||
|
|
||||||
cmp ax, 0
|
cmp ax, 0
|
||||||
jne .resolve_rsdp
|
jne .rsdp_found
|
||||||
|
|
||||||
add ecx, 16
|
add ecx, 16
|
||||||
cmp ecx, 0x100000
|
cmp ecx, 0x100000
|
||||||
|
@ -105,7 +105,6 @@ acpi_search_rsdt:
|
||||||
|
|
||||||
; If no "RSD PTR "-signature could be found
|
; If no "RSD PTR "-signature could be found
|
||||||
xor ecx, ecx
|
xor ecx, ecx
|
||||||
jmp .epilog
|
|
||||||
|
|
||||||
.resolve_rsdp:
|
.resolve_rsdp:
|
||||||
; The 4-byte RSDT-pointer is at byte-offset 4 into the RSDP strucfture.
|
; The 4-byte RSDT-pointer is at byte-offset 4 into the RSDP strucfture.
|
||||||
|
|
|
@ -34,7 +34,7 @@ initialize_pci_driver:
|
||||||
|
|
||||||
push ebp
|
push ebp
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
push dword PCI_DEVICE_COUNT_OFFSET
|
push ebx
|
||||||
push dword 2
|
push dword 2
|
||||||
push dword 0
|
push dword 0
|
||||||
push dword 0
|
push dword 0
|
||||||
|
|
|
@ -190,12 +190,11 @@ pci_enumerate_bus:
|
||||||
|
|
||||||
mov [esi + (64 - 8)], ebx
|
mov [esi + (64 - 8)], ebx
|
||||||
mov [esi + (64 - 12)], ecx
|
mov [esi + (64 - 12)], ecx
|
||||||
mov [esi + (64 - 16)], edx
|
|
||||||
mov [esi + (64 - 20)], edi
|
mov [esi + (64 - 20)], edi
|
||||||
; [esi]: Device-in-bus Index
|
; [esi]: Device-in-bus Index
|
||||||
; [esi + 4]: Number of existing devices
|
; [esi + 4]: Number of existing devices
|
||||||
; [esi + 8]: Bus number
|
; [esi + 8]: Bus number
|
||||||
; [esi + 12]: PCI driver area pointer
|
; [esi + 12]:
|
||||||
mov [esi], dword 0
|
mov [esi], dword 0
|
||||||
mov [esi + 4], dword 0
|
mov [esi + 4], dword 0
|
||||||
mov eax, [ebp - 8]
|
mov eax, [ebp - 8]
|
||||||
|
@ -260,7 +259,6 @@ pci_enumerate_bus:
|
||||||
.epilog:
|
.epilog:
|
||||||
mov ebx, [esi + (64 - 8)]
|
mov ebx, [esi + (64 - 8)]
|
||||||
mov ecx, [esi + (64 - 12)]
|
mov ecx, [esi + (64 - 12)]
|
||||||
mov edx, [esi + (64 - 16)]
|
|
||||||
mov edi, [esi + (64 - 20)]
|
mov edi, [esi + (64 - 20)]
|
||||||
|
|
||||||
mov eax, [esi + 4]
|
mov eax, [esi + 4]
|
||||||
|
@ -315,6 +313,7 @@ pci_enumerate:
|
||||||
cmp edx, [ebp - 8]
|
cmp edx, [ebp - 8]
|
||||||
jae .epilog
|
jae .epilog
|
||||||
|
|
||||||
|
|
||||||
.call_bus_enumerator:
|
.call_bus_enumerator:
|
||||||
push ebp
|
push ebp
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
|
|
|
@ -54,12 +54,6 @@ stage_2_setup_entry:
|
||||||
bits 32
|
bits 32
|
||||||
stage2_protected_entry:
|
stage2_protected_entry:
|
||||||
|
|
||||||
push ebp
|
|
||||||
mov ebp, esp
|
|
||||||
call setup_drivers
|
|
||||||
mov esp, ebp
|
|
||||||
pop ebp
|
|
||||||
|
|
||||||
cli
|
cli
|
||||||
hlt
|
hlt
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue