Coder Social home page Coder Social logo

Higher half about baremetal-os-legacy HOT 3 OPEN

returninfinity avatar returninfinity commented on June 19, 2024
Higher half

from baremetal-os-legacy.

Comments (3)

Roxxik avatar Roxxik commented on June 19, 2024

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?

from baremetal-os-legacy.

IanSeyler avatar IanSeyler commented on June 19, 2024

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.

from baremetal-os-legacy.

Roxxik avatar Roxxik commented on June 19, 2024

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

from baremetal-os-legacy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.