...
This commit is contained in:
18
.clang-format
Normal file
18
.clang-format
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
IndentWidth: 4
|
||||||
|
ColumnLimit: 120
|
||||||
|
|
||||||
|
# Pointer formatting
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
PointerAlignment: Left
|
||||||
|
|
||||||
|
# Function formatting
|
||||||
|
AllowShortFunctionsOnASingleLine: None
|
||||||
|
|
||||||
|
# Control how short statements are placed
|
||||||
|
AllowShortBlocksOnASingleLine: Never
|
||||||
|
AllowShortIfStatementsOnASingleLine: Never
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
|
||||||
|
SeparateDefinitionBlocks: Always
|
||||||
|
|
||||||
|
BreakBeforeBraces: Allman
|
||||||
37
src/boot.asm
37
src/boot.asm
@@ -1,6 +1,32 @@
|
|||||||
[org 0x7c00]
|
[org 0x7c00]
|
||||||
[bits 16]
|
[bits 16]
|
||||||
|
|
||||||
|
KERNEL_LOCATION equ 0x1000
|
||||||
|
|
||||||
|
mov [BOOT_DISK], dl
|
||||||
|
|
||||||
|
xor ax, ax
|
||||||
|
mov es, ax
|
||||||
|
mov ds, ax
|
||||||
|
mov bp, 0x8000
|
||||||
|
mov sp, bp
|
||||||
|
|
||||||
|
mov bx, KERNEL_LOCATION
|
||||||
|
mov dh, 2
|
||||||
|
|
||||||
|
mov ah, 0x02
|
||||||
|
mov al, dh
|
||||||
|
mov ch, 0x00
|
||||||
|
mov dh, 0x00
|
||||||
|
mov cl, 0x02
|
||||||
|
mov dl, [BOOT_DISK]
|
||||||
|
int 0x13
|
||||||
|
|
||||||
|
|
||||||
|
mov ah, 0x0
|
||||||
|
mov al, 0x3
|
||||||
|
int 0x10
|
||||||
|
|
||||||
CODE_SEG equ gdt_code - gdt_start
|
CODE_SEG equ gdt_code - gdt_start
|
||||||
|
|
||||||
cli
|
cli
|
||||||
@@ -40,6 +66,17 @@ gdt_descriptor:
|
|||||||
|
|
||||||
[bits 32]
|
[bits 32]
|
||||||
start_protected_mode:
|
start_protected_mode:
|
||||||
|
mov ax, DATA_SEG
|
||||||
|
mov ds, ax
|
||||||
|
mov ss, ax
|
||||||
|
mov es, ax
|
||||||
|
mov fs, ax
|
||||||
|
mov gs, ax
|
||||||
|
|
||||||
|
mov ebp, 0x90000
|
||||||
|
mov esp, ebp
|
||||||
|
|
||||||
|
jmp KERNEL_LOCATION
|
||||||
jmp $
|
jmp $
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
*(char*)0xb8000 = 'A';
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
5
src/kernel_entry.asm
Normal file
5
src/kernel_entry.asm
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
section .text
|
||||||
|
[bits 32]
|
||||||
|
[extern main]
|
||||||
|
call main
|
||||||
|
jmp $
|
||||||
Reference in New Issue
Block a user