On Mon Jan 20 20:21:28 EST 2014, p...@fb.com wrote: > Hi, > > in 9/pc/mem.h it says: > /* > * Address spaces > */ > #define KZERO 0xF0000000 /* base of kernel > address space */ > #define KTZERO (KZERO+0x100000) /* first address in > kernel text - 9load sits below */ > > > and in 9/pc/mkfile: > # must match mem.h > APBOOTSTRAP=0xF0003000 > KTZERO=0xF0100020 > > > so why the difference? what is this additional 20 for KTZERO?
ah, good question. KZERO is the lowest virtual address that's part of the kernel proper. in the mkfile, the address of the first instruction is wanted to pass to the linker. this is KTZERO in the mkfile. in mem.h, the page containing the first instruction is wanted for mmu mapping, etc., and that's a little different. it's a bit fast-and-loose, and perhaps incorrect to use the same name for both. perhaps #define KTPZERO ROUNDDN(KTZERO, BY2PG) would have been less confusing. - erik