| Commit message (Collapse) | Author | Age |
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
we use the first pml4 entry (+one pdp table) to map phy 0~512G
to virt 0~512G for init code. This doesn't change.
For the kernel to work in higher half memory, we also need to create
mapping for it. We take the 256th entry of pml4 entry (hence one
additional pdp table).
Entry 0~63 are mapped to to the physical memory
(with offset 0xffff_8000_0000_0000)
Entry 64~127 are not used
Entry 128~191 are mapped to the kernel image (text and code)
(with offset 0xffff_8020_0000_0000)
details in docs/mem_layout.txt
|
| |
|
|
|
|
|
|
|
|
| |
the x86_64 crate is pretty solid and has a permissive license
(Apache/MIT), but I want to make this myself in the future to
"experience" the unsafe rust further....Also it has too many
abstractions, which is justified as a library, but not ideal for a from
sctrach toy OS as it hides the lower end.
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
|
|
|
| |
use 8MiB reserved array to manage up to 4GiB of physical memory
(4K Pages only)
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
|
|
|
|
| |
well, it's not trivial to use bios function because thanks to grub +
multiboot, we are already in protected mode when the startup code takes
control. Also the MB info is easier to play with than BIOS (or ACPI)
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
|
|
|
|
| |
some keys such as the Win key has larger scancode, causing out-of-bound
read in the translation table. As a temp fix pad the tables with 0 up to
100 chars.
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
1. throw vectors in a custom ".reserved" section
2. throw idt in a NOLOAD ".reserved_0" section: save some binary size
(like .bss) since we don't care for its initial value.
3. squash all ".data.*" sections from rust into ".data"
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
works on qemu, untested on real machine
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
So that device IO can be be synchronized.
|
| |
|
|
| |
Merge key modifier getters and setters
|
| |
|
|
|
| |
In arm we will be using MMIO instead of the IO instructions.
However the peripherals should use the same interface for IOs.
|
| | |
|
| |
|
|
|
|
| |
The println! and print! macros are defined in submodule "io",
I have to add this trick to make it work across the crate.
Maybe there is a better way...
|
| |
|
|
|
| |
The rust lazy_static requires interior mutability. I have to include a
Mutex impl (spin::Mutex). But I'd like to implement my own primitives.
|
| | |
|
| |
|
|
|
|
| |
to make the linter shutup.... You stupid linter, this is a new project!
ofc there are stuffs defined not used.... I'll let you do the job when I
finish... :(
|
| | |
|