Some commenting

This commit is contained in:
Thomas Lovén 2022-01-06 00:08:20 +01:00
parent 2179aa3ce0
commit 2458a3db69
4 changed files with 15 additions and 11 deletions

View File

@ -19,19 +19,19 @@ _start:
mov edi, eax
mov esi, ebx
// Temporary stack for booting
//; Temporary stack for booting
mov esp, offset V2P(BootStack)
// Enable Page Address Extension
//; Enable Page Address Extension
mov eax, cr4
or eax, 1<<5
mov cr4, eax
// Load Page Table (defined in boot/boot_PT.S)
//; Load Page Table (defined in boot/boot_PT.S)
mov eax, offset V2P(BootP4)
mov cr3, eax
// Enable Long Mode
//; Enable Long Mode
mov ecx, 0xC0000080
rdmsr
or eax, 1<<8
@ -42,16 +42,16 @@ _start:
or eax, 1<<31
mov cr0, eax
// Load GDT (defined in cpu/gdt.c)
//; Load GDT (defined in cpu/gdt.c)
lgdt [V2P(GDTp)]
// Jump into long mode
//; Jump into long mode
jmp 0x8:V2P(long_mode_start)
.code64
long_mode_start:
// Clear out selectors
//; Clear out selectors
mov eax, 0x0
mov ss, eax
mov ds, eax
@ -84,7 +84,7 @@ upper_memory:
.reload_cs:
.extern kmain
.extern kmain //; boot/kmain.c
movabs rax, offset kmain
call rax

View File

@ -42,8 +42,9 @@ struct fbinfo {
int parse_multiboot2(struct taglist *tags)
{
struct tag *tag = incptr(tags, sizeof(struct taglist));
struct mmap *mmap;
struct tag *tag = incptr(tags, sizeof(struct taglist));
while(tag->type)
{
debug("Tag type: %d\n", tag->type);
@ -64,6 +65,7 @@ int parse_multiboot2(struct taglist *tags)
break;
}
// Tags are 8 byte alligned, so make sure we look for the next one in the right place
int padded_size = tag->size + ((tag->size % 8)?(8-(tag->size%8)):0);
tag = incptr(tag, padded_size);
}

View File

@ -8,7 +8,9 @@ Multiboot2Header:
.long MBOOT2_LENGTH
.long MBOOT2_CHECKSUM
.short 0
//; Multiboot tag list
.short 0 //; End tag
.short 0
.long 8

View File

@ -42,7 +42,7 @@ void interrupt_init()
idtr.addr = idt;
idtr.len = sizeof(idt)-1;
load_idt(&idtr);
load_idt(&idtr); // cpu/registers.S
}
registers *int_handler(registers *r)