-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.S
35 lines (29 loc) · 881 Bytes
/
main.S
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
/*
This file is part of Jacqueline: an experimental i386 bootable application
Copyright (C) 2020 Dani Rodríguez <dani@danirod.es>
main.S -- start here! stuff that just has to be done in assembly
*/
.text
/* Multiboot magic numbers are required to be present at the binary head. */
#define MULTIBOOT_MAGIC_NUMBER 0x1BADB002
#define MULTIBOOT_FLAGS 0x00000003
#define MULTIBOOT_CHECKSUM -(MULTIBOOT_MAGIC_NUMBER + MULTIBOOT_FLAGS)
.align 4
bootHead: /* and another boot to her wimpy husband Hank */
.int MULTIBOOT_MAGIC_NUMBER
.int MULTIBOOT_FLAGS
.int MULTIBOOT_CHECKSUM
/* The binary ELF file loaded by the bootloader starts running code HERE. */
#define STACK_SIZE 0x4000
.global bootMain
bootMain:
movl $(Stack + STACK_SIZE), %esp
call kernelMain
/* Infinite loop once kmain is done. */
bootPostMain:
cli
hlt
jmp bootPostMain
.bss
.align 4
.lcomm Stack, STACK_SIZE