Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Higher half #2

Open
IanSeyler opened this issue Feb 4, 2012 · 3 comments
Open

Higher half #2

IanSeyler opened this issue Feb 4, 2012 · 3 comments

Comments

@IanSeyler
Copy link
Member

Move the kernel to the higher half of memory (0xFFFF800000000000).

Required adjustment of the PML4.

@Roxxik
Copy link
Contributor

Roxxik commented Jul 7, 2015

Why would we want to put the Kernel up there?

All the reasons I Saw for doing so are:

  1. 32-bit binaries can use the whole address space
    • we don't have precompiled 32-bit binaries for BareMetal
  2. It's easier to set up VM86 processes
    • currently there is no option to switch to VM86 mode and i don't think its planned
  3. The Applications don't have to know how much memory is required by the Kernel
    • I think with such a tiny Kernel we're unlikely to hit 0x200000 soon so that should be ok too

If there are reasons to put the Kernel in the higher helf please let me know, otherwise it'd suggest to keep it just where it is

P.S. Am I right in my prediction that the whole memory just gets identity mapped?

@IanSeyler
Copy link
Member Author

The main reason was to have a linear range of memory without gaps. There are a lot of gaps in lower memory that can't be used by an application. The plan would be to map available memory starting at the higher half and run out of there without worrying about gaps.

@Roxxik
Copy link
Contributor

Roxxik commented Jul 7, 2015

ah ok this sounds reasonable
isn't this a issue of th bootloader?
especially this part

; Move the trailing binary to its final location
mov rsi, 0x8000+6144 ; Memory offset to end of pure64.sys
mov rdi, 0x100000 ; Destination address at the 1MiB mark
mov rcx, 0x0D00 ; For up to 26KiB kernel (26624 / 8)
rep movsq ; Copy 8 bytes at a time

and all the things calling the kernel syscalls (0x100010 - 0x1000C0 at the moment) must be adjusted
EDIT: and the paging table

@ghost ghost mentioned this issue Oct 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants