From 8f108466fac9a6fb96ec20a098f52211c84c4a70 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 13 Oct 2022 07:35:59 +0300 Subject: [PATCH] Added "Loading..." text at boot --- Architecture/i686/boot.asm | 74 +++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/Architecture/i686/boot.asm b/Architecture/i686/boot.asm index d371c46..277066d 100644 --- a/Architecture/i686/boot.asm +++ b/Architecture/i686/boot.asm @@ -31,42 +31,52 @@ extern _kernel_end global _start _start: - mov esp, STACK_TOP - KERNEL_VIRTUAL_BASE - mov edi, BOOT_PAGE_TBL0 - KERNEL_VIRTUAL_BASE - mov esi, 0 - mov ecx, 2048 - 301 + mov word [0xb8000], 0x074C ; L + mov word [0xb8002], 0x076F ; o + mov word [0xb8004], 0x0761 ; a + mov word [0xb8006], 0x0764 ; d + mov word [0xb8008], 0x0769 ; i + mov word [0xb800a], 0x076E ; n + mov word [0xb800c], 0x0767 ; g + mov word [0xb800e], 0x072E ; . + mov word [0xb8010], 0x072E ; . + mov word [0xb8012], 0x072E ; . + mov esp, STACK_TOP - KERNEL_VIRTUAL_BASE + mov edi, BOOT_PAGE_TBL0 - KERNEL_VIRTUAL_BASE + mov esi, 0 + mov ecx, 2048 - 301 .PagingLoop: - cmp esi, _kernel_start - KERNEL_VIRTUAL_BASE - jl .LoopInside - cmp esi, _kernel_end - KERNEL_VIRTUAL_BASE - jge .LoopEnd - mov eax, esi - or eax, 3 - mov [edi], eax + cmp esi, _kernel_start - KERNEL_VIRTUAL_BASE + jl .LoopInside + cmp esi, _kernel_end - KERNEL_VIRTUAL_BASE + jge .LoopEnd + mov eax, esi + or eax, 3 + mov [edi], eax .LoopInside: - add esi, 4096 - add edi, 4 - loop .PagingLoop + add esi, 4096 + add edi, 4 + loop .PagingLoop .LoopEnd: - push ebx - mov dword [BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + (000 * 4)], (BOOT_PAGE_TBL0 - KERNEL_VIRTUAL_BASE + 3) - mov dword [BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + (001 * 4)], (BOOT_PAGE_TBL1 - KERNEL_VIRTUAL_BASE + 3) - mov dword [BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + (896 * 4)], (BOOT_PAGE_TBL0 - KERNEL_VIRTUAL_BASE + 3) - mov dword [BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + (897 * 4)], (BOOT_PAGE_TBL1 - KERNEL_VIRTUAL_BASE + 3) - mov ecx, BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE - mov cr3, ecx - mov ecx, cr0 - or ecx, 0x80010000 - mov cr0, ecx - add esp, KERNEL_VIRTUAL_BASE - mov eax, CallKernelMain - jmp eax + push ebx + mov dword [BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + (000 * 4)], (BOOT_PAGE_TBL0 - KERNEL_VIRTUAL_BASE + 3) + mov dword [BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + (001 * 4)], (BOOT_PAGE_TBL1 - KERNEL_VIRTUAL_BASE + 3) + mov dword [BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + (896 * 4)], (BOOT_PAGE_TBL0 - KERNEL_VIRTUAL_BASE + 3) + mov dword [BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + (897 * 4)], (BOOT_PAGE_TBL1 - KERNEL_VIRTUAL_BASE + 3) + mov ecx, BOOT_PAGE_DIR0 - KERNEL_VIRTUAL_BASE + mov cr3, ecx + mov ecx, cr0 + or ecx, 0x80010000 + mov cr0, ecx + add esp, KERNEL_VIRTUAL_BASE + mov eax, CallKernelMain + jmp eax section .text CallKernelMain: - push ebx - call x32Entry - cli + push ebx + call x32Entry + cli .hang: - hlt - jmp .hang + hlt + jmp .hang