CoolPotOS/boot/boot.asm

54 lines
928 B
NASM
Raw Normal View History

2024-04-09 23:46:56 +08:00
2024-05-21 21:09:04 +08:00
.set MAGIC, 0x1badb002
.set FLAGS, 7
/*.set FLAGS, 3 */
2024-05-19 18:05:00 +08:00
.set CHECKSUM, -(MAGIC + FLAGS)
2024-05-21 21:09:04 +08:00
.set MODE_TYPE, 0
.set WIDTH, 1280 /* requested width */
.set HEIGHT, 720 /* requested height */
/* .set WIDTH, 640
.set HEIGHT, 480 */
.set DEPTH, 32 /* requested bits per pixel BPP */
.set HEADER_ADDR, 0
.set LOAD_ADDR, 0
.set LOAD_END_ADDR, 0
.set BSS_END_ADDR, 0
.set ENTRY_ADDR, 0
2024-04-09 23:46:56 +08:00
.section .multiboot
.long MAGIC
2024-05-21 21:09:04 +08:00
.long FLAGS
.long CHECKSUM
.long HEADER_ADDR
.long LOAD_ADDR
.long LOAD_END_ADDR
.long BSS_END_ADDR
.long ENTRY_ADDR
.long MODE_TYPE
.long WIDTH
.long HEIGHT
.long DEPTH
/* enough space for the returned header */
.space 4 * 13
2024-04-09 23:46:56 +08:00
.section .bss
.align 16
stack_bottom:
.skip 16384 # 16 KiB
stack_top:
.section .text
.global _start
.type _start, @function
_start:
mov $stack_top, %esp
2024-05-21 21:09:04 +08:00
push %ebx
2024-04-09 23:46:56 +08:00
call kernel_main
cli
1: hlt
jmp 1b
.size _start, . - _start