blob: 10b6b255ab95d6cf34c8689424702a50019ca37c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
bits 32
%define STACK_POINTER 0x00500000 ; The initial stack pointer in kernel mode
%define MULTIBOOT_MAGIC 0x1badb002
%define MULTIBOOT_PAGE_ALIGN 0x1
%define MULTIBOOT_MEMORY_INFO 0x2
%define MULTIBOOT_VIDEO_MODE 0x4
%define MULTIBOOT_FLAGS (MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_VIDEO_MODE)
%define MULTIBOOT_CHECKSUM -(MULTIBOOT_MAGIC + MULTIBOOT_FLAGS)
section .text
align 4
dd MULTIBOOT_MAGIC
dd MULTIBOOT_FLAGS
dd MULTIBOOT_CHECKSUM
; MULTIBOOT_MEMORY_INFO
dd 0x00000000
dd 0x00000000
dd 0x00000000
dd 0x00000000
dd 0x00000000
; MULTIBOOT_VIDEO_MODE
dd 0x00000000
dd 1280
dd 1024
dd 32
global boot_entry
extern kernel_main
boot_entry:
mov esp, STACK_POINTER
push ebx
push eax
cli
call kernel_main
hlt
jmp $
|