PKUOS - Pintos
Pintos source browser for PKU Operating System course
Macros | Variables
loader.h File Reference
#include <stdint.h>
Include dependency graph for loader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LOADER_BASE   0x7c00
 Constants fixed by the PC BIOS. More...
 
#define LOADER_END   0x7e00
 Physical address of end of loader. More...
 
#define LOADER_KERN_BASE   0x20000
 Physical address of kernel base. More...
 
#define LOADER_PHYS_BASE   0xc0000000
 Kernel virtual address at which all physical memory is mapped. More...
 
#define LOADER_SIG   (LOADER_END - LOADER_SIG_LEN)
 Important loader physical addresses. More...
 
#define LOADER_PARTS   (LOADER_SIG - LOADER_PARTS_LEN)
 Partition table. More...
 
#define LOADER_ARGS   (LOADER_PARTS - LOADER_ARGS_LEN)
 Command-line args. More...
 
#define LOADER_ARG_CNT   (LOADER_ARGS - LOADER_ARG_CNT_LEN)
 Number of args. More...
 
#define LOADER_SIG_LEN   2
 Sizes of loader data structures. More...
 
#define LOADER_PARTS_LEN   64
 
#define LOADER_ARGS_LEN   128
 
#define LOADER_ARG_CNT_LEN   4
 
#define SEL_NULL   0x00
 GDT selectors defined by loader. More...
 
#define SEL_KCSEG   0x08
 Kernel code selector. More...
 
#define SEL_KDSEG   0x10
 Kernel data selector. More...
 

Variables

uint32_t init_ram_pages
 Amount of physical memory, in 4 kB pages. More...
 

Macro Definition Documentation

◆ LOADER_ARG_CNT

#define LOADER_ARG_CNT   (LOADER_ARGS - LOADER_ARG_CNT_LEN)

Number of args.

Definition at line 19 of file loader.h.

◆ LOADER_ARG_CNT_LEN

#define LOADER_ARG_CNT_LEN   4

Definition at line 25 of file loader.h.

◆ LOADER_ARGS

#define LOADER_ARGS   (LOADER_PARTS - LOADER_ARGS_LEN)

Command-line args.

Definition at line 18 of file loader.h.

◆ LOADER_ARGS_LEN

#define LOADER_ARGS_LEN   128

Definition at line 24 of file loader.h.

◆ LOADER_BASE

#define LOADER_BASE   0x7c00

Constants fixed by the PC BIOS.

Physical address of loader's base.

Definition at line 5 of file loader.h.

◆ LOADER_END

#define LOADER_END   0x7e00

Physical address of end of loader.

Definition at line 6 of file loader.h.

◆ LOADER_KERN_BASE

#define LOADER_KERN_BASE   0x20000

Physical address of kernel base.

128 kB.

Definition at line 9 of file loader.h.

◆ LOADER_PARTS

#define LOADER_PARTS   (LOADER_SIG - LOADER_PARTS_LEN)

Partition table.

Definition at line 17 of file loader.h.

◆ LOADER_PARTS_LEN

#define LOADER_PARTS_LEN   64

Definition at line 23 of file loader.h.

◆ LOADER_PHYS_BASE

#define LOADER_PHYS_BASE   0xc0000000

Kernel virtual address at which all physical memory is mapped.

Must be aligned on a 4 MB boundary. 3 GB.

Definition at line 13 of file loader.h.

◆ LOADER_SIG

#define LOADER_SIG   (LOADER_END - LOADER_SIG_LEN)

Important loader physical addresses.

0xaa55 BIOS signature.

Definition at line 16 of file loader.h.

◆ LOADER_SIG_LEN

#define LOADER_SIG_LEN   2

Sizes of loader data structures.

Definition at line 22 of file loader.h.

◆ SEL_KCSEG

#define SEL_KCSEG   0x08

Kernel code selector.

Definition at line 30 of file loader.h.

◆ SEL_KDSEG

#define SEL_KDSEG   0x10

Kernel data selector.

Definition at line 31 of file loader.h.

◆ SEL_NULL

#define SEL_NULL   0x00

GDT selectors defined by loader.

More selectors are defined by userprog/gdt.h. Null selector.

Definition at line 29 of file loader.h.

Variable Documentation

◆ init_ram_pages

uint32_t init_ram_pages
extern

Amount of physical memory, in 4 kB pages.

threads/loader.h

Referenced by pagedir_set_page(), paging_init(), palloc_init(), and pintos_init().