Skip to content

Commit

Permalink
expand tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
5lipper committed Oct 27, 2016
1 parent 68a6597 commit 028f39d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions kernel.c
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions kernel.h
Expand Up @@ -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, ...);

Expand Down
4 changes: 2 additions & 2 deletions linux_thunk.S
Expand Up @@ -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
Expand Down

0 comments on commit 028f39d

Please sign in to comment.