Comments (6)
Some assumptions from my side:
each 2MiB Page has one Byte in the os_MemoryMap structure
0x01 is free
0x02 is used
the whole memory is identity mapped (behave like paging is off)
PML4 is a structure to keep track of virtual memory pages
From Pure64/Pure64.asm/line 183
; The higher half is identity mapped to the lower half
This comment doesn't make sense to me because identity mapping means mapping to the same address
I'd recommend to set up the paging tables so that we can enter long mode(basically identity map everything) and keep the usage information in a seperate region
This has the drawbacks, that we can't load more than one application at a time unless
- we build a loader
- we use position independent executables which can be load everywhere
with paging enabled we could load more than one application to virtual address 0x200000, but this hinders IPC because u cannot just share some pointer between the two and but a spinlock infront of it
for that we either have to build some shared memory or build something into the Kernel that can share information between processes
from baremetal-os-legacy.
The question is if there are plans to make BareMetal-OS a multi-threading and multi-tasking OS.
If yes, then there is another question.
Will it have memory isolation and the usual “a single process cannot crash the whole OS” mechanisms?
Just keep in mind that BareMetal is an exokernel, which means every program will have to supply it's own drivers, which could influence each other.
from baremetal-os-legacy.
Also a link to what PML4 exactly is: https://lwn.net/Articles/106177/
from baremetal-os-legacy.
The idea here is to use the PML4 as the memory map instead of the separate 128KB os_MemoryMap
.
I was going to test using the User/supervisor
, Accessed
, or Dirty
bit in each PD entry to mark if a page is actually in use.
More info on those bits are in the Intel SDM docs. Section 4.4.2 - Table 4-9.
from baremetal-os-legacy.
Following up the questions from @benaryorg
The BareMetal exokernel supports multi-threading but not in the conventional sense that most operating systems use. A thread is locked to a CPU core in BareMetal. If you spawn 5 "threads" and only have 4 cores then the last thread will only run once one of the first have completed.
No worries on drivers. BareMetal publishes a simple API for the drivers (network and disk).
Right now a single bad program can crash the OS (for instance if you overwrite the IDT at memory address 0x0). There needs to be some work done to make sure that isn't possible.
from baremetal-os-legacy.
Will this be Ok if we allocate the pages based on Present flag at the place of os_MemoryMap??
Here it will be required to pre-allocate the pages of IDT and page-fault handler code.
And afterwords we can allocate pages on page-fault.
For initial implementations this to implement, we can try the already loaded pages as not present by marking the page-flags in pagetables(PDE's) to not present(demand paging)[i have already tried the page-fault handler working fine for Pure64, and exact pages need to identity which should be kept pre-allocated for BareMetalOS(like for new IDT, SMP..)].
Can work on loading pages from disk later on(which ideally required.) by taking the file-sector number and offset-sector into it to be linked to particular PDE entry.
from baremetal-os-legacy.
Related Issues (20)
- porting baremetal-os on risc-v HOT 3
- It's actually 2015 now... HOT 3
- Memory mapped files (or file mapped virtual address space for one program/process/thread) HOT 9
- [INFO] 64-bit ARM HOT 7
- Stuck at iddrive_poll with VirtualBox HOT 7
- asm2c
- SATA drive support HOT 3
- Use switch tables instead of long strings of cmp/je combos HOT 2
- README.md says autoconf -fi HOT 4
- Boot from usb HOT 1
- tried to add elf format support but failed to run any app HOT 2
- Safe to run on a physical host yet? HOT 1
- Hi, I can't to run the BareMetal-OS HOT 5
- BareMetal Rust HOT 2
- e1000 driver does not setup bus mastering HOT 5
- CRLF or LF or CR or ? HOT 4
- os_output_char in Kernel API HOT 5
- LICENCE.TXT / CREDITS.TXT HOT 3
- BareMetal Rust PoC HOT 4
- Loader HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baremetal-os-legacy.