| Commit message (Collapse) | Author | Age |
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
1. define trampolines for both exceptions with error code (automatically
pushed to stack) and those without.
2. do not repeat vectors for unused IRQ numbers: we need 48, no need to
fill in 256.
3. also pass the pointer to trap frame (on the stack) to the handler
code
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
| |
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
for a no_std build with custom target, we need to build the rust
compoments including core, alloc and compiler builtins. Previously we
do this with the cargo xbuild tool. however it has some bugs with newer
toolchains. The official build-std feature is not stable but looks
promising! Also we could reduce a lot of build dependencies.
References: https://github.com/rust-in-action/code/issues/14
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. allow unexpected cfgs in lib.rs, in this case
"no_global_oom_handling" is cause warnings [1]
2. for large code models the compiler (rust linkers) now put code and
data in `.ltext`, `.ldata`, `.lbss`, `.lrodata` instead of the
same `.text` , `.data` ... etc. We are adjusting accordingly in the
linker script.
3. unsafe assertions identified undefined behaviours, in this case a repr(C)
struct was not mared as repr(packed), therefore having an unexpected
size. The unsafe assertions was not enabled by default in debug
builds so the idt setup code with from_raw_parts_mut() has been
working on UB. Glad we can catch this....
related: [1] https://github.com/rust-lang/rust/pull/123501
related: [2] https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html#asserting-unsafe-preconditions
|
| | |
|
| |
|
|
| |
Also renamed a few symbols to avoid confusion.
|
| |
|
|
|
| |
should be 0xffff_8020_0000_0000, but I used the id mapping by mistake
(0xffff_8000_0000_0000)
|
| |
|
|
| |
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>
|
| |
|
|
|
|
|
| |
we should define debug and release targets, but hardcoding in makefile
for now.
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>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
- update regarding contributing
- fix typo
- update roadmap
- fix toc link
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|