X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Floader.S;h=796dca8c3dd101b5ef61f2708eeb6f8c9bebf223;hb=f5dc6608c39a1ba7f92aec4ac7f04ec7281de6b4;hp=2bfe1a45304c8756fb1cba4b14bd30af076c6320;hpb=2eda07105e94747981c8b813dee62e512b496460;p=pintos-anon diff --git a/src/threads/loader.S b/src/threads/loader.S index 2bfe1a4..796dca8 100644 --- a/src/threads/loader.S +++ b/src/threads/loader.S @@ -119,12 +119,13 @@ start: mov ah, 0x88 int 0x15 jc panic + cli # BIOS might have enabled interrupts add eax, 1024 # Total kB memory cmp eax, 0x10000 # Cap at 64 MB jbe 1f mov eax, 0x10000 1: shr eax, 2 # Total 4 kB pages - mov ram_pages, eax + mov ram_pgs, eax #### Create temporary page directory and page table and set page #### directory base register. @@ -303,7 +304,7 @@ gdtdesc: #### Print panicmsg (with help from the BIOS) and spin. panic: .code16 # We only panic in real mode. - mov si, offset panicmsg + mov si, offset panic_message mov ah, 0xe sub bh, bh 1: lodsb @@ -312,22 +313,27 @@ panic: .code16 # We only panic in real mode. int 0x10 jmp 1b -panicmsg: - .ascii "Loader panic!\r\n" +panic_message: + .ascii "Panic!" .byte 0 -#### Memory size in 4 kB pages. - .org LOADER_RAM_PAGES - LOADER_BASE -ram_pages: +#### Physical memory size in 4 kB pages. +#### This is initialized by the loader and read by the kernel. + .org LOADER_RAM_PGS - LOADER_BASE +ram_pgs: .long 0 -#### Command-line arguments inserted by another utility. -#### The loader doesn't use these, but we note their -#### location here for easy reference. - .org LOADER_CMD_LINE - LOADER_BASE -cmd_line: +#### Command-line arguments and their count. +#### This is written by the `pintos' utility and read by the kernel. +#### The loader itself does not do anything with the command line. + .org LOADER_ARG_CNT - LOADER_BASE +arg_cnt: + .long 0 + .org LOADER_ARGS - LOADER_BASE +args: .fill 0x80, 1, 0 -#### Boot-sector signature for BIOS inspection. - .org LOADER_BIOS_SIG - LOADER_BASE +#### Boot-sector signature. +#### The BIOS checks that this is set properly. + .org LOADER_SIG - LOADER_BASE .word 0xaa55