diff --git a/kernel.c b/kernel.c index a84f962..171b1cc 100644 --- a/kernel.c +++ b/kernel.c @@ -241,24 +241,24 @@ int kernel_init(void) kern.kern_base = (u64)(early_printf - kern_off_printf); if ((kern.kern_base & PAGE_MASK) != 0) { - eprintf("Kernel base is not aligned\n"); + eprintf("Kernel base is not aligned\n"); return 0; - } else { - eprintf("Kernel base = %p\n", kern.kern_base); - } + } else { + eprintf("Kernel base = %p\n", kern.kern_base); + } - u64 DMPML4I = *(u32 *)(kern.kern_base + kern_off_dmpml4i); - u64 DMPDPI = *(u32 *)(kern.kern_base + kern_off_dmpdpi); + u64 DMPML4I = *(u32 *)(kern.kern_base + kern_off_dmpml4i); + u64 DMPDPI = *(u32 *)(kern.kern_base + kern_off_dmpdpi); #else - kern.kern_base = KVADDR(0x1ff, 0x1fe, 0, 0); // 0xffffffff80000000 + kern.kern_base = KVADDR(0x1ff, 0x1fe, 0, 0); // 0xffffffff80000000 - u64 DMPML4I = 0x1fc; - u64 DMPDPI = 0; + u64 DMPML4I = 0x1fc; + u64 DMPDPI = 0; #endif - kern.dmap_base = KVADDR(DMPML4I, DMPDPI, 0, 0); - eprintf("Direct map base = %p\n", kern.dmap_base); + kern.dmap_base = KVADDR(DMPML4I, DMPDPI, 0, 0); + eprintf("Direct map base = %p\n", kern.dmap_base); // We may not be mapped writable yet, so to be able to write to globals // we need WP disabled. diff --git a/kernel.h b/kernel.h index 07e7c67..f29111e 100644 --- a/kernel.h +++ b/kernel.h @@ -52,9 +52,9 @@ struct sysent_t { }; struct ksym_t { - // two parameters related to kaslr (they are not symbols) - uintptr_t kern_base; - uintptr_t dmap_base; + // two parameters related to kaslr (they are not symbols) + uintptr_t kern_base; + uintptr_t dmap_base; int (*printf)(const char *fmt, ...); diff --git a/linux_thunk.S b/linux_thunk.S index 74d15eb..f6d2dfb 100644 --- a/linux_thunk.S +++ b/linux_thunk.S @@ -42,8 +42,8 @@ jmp_to_linux: # TODO make sure we don't inadvertently overwrite (important) smap regions # I think on ps4 we'll actually want to load to 0x700000 # since we have tons of free room there. - # on 4.00/4.01, bzImage might be allocated at 0x800000 accidently. We - # should choose a higher address as pref_address. + # on 4.00/4.01, bzImage might be allocated at 0x800000 accidently. We + # should choose a higher address as pref_address. # save args mov r12, rdi