aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* mm: provide high memory kernel mapping in asm code.Tianhao Wang2024-06-11
| | | | | | | | | | | | | | | | | 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
* mm: add basic paging infra from x86_64 crateTianhao Wang2024-06-11
| | | | | | | | | | 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>
* mm: fix Range type and addr roundingTianhao Wang2024-06-11
| | | | Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
* mm: add stack based PMATianhao Wang2024-06-11
| | | | | | | use 8MiB reserved array to manage up to 4GiB of physical memory (4K Pages only) Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
* multiboot: docs and cleanupTianhao Wang2024-06-11
| | | | Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
* multiboot: parse mmap blocksTianhao Wang2024-06-11
| | | | Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
* multiboot: get memory info from MB infoTianhao Wang2024-06-11
| | | | Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
* multiboot: basic support for multiboot infoTianhao Wang2024-06-11
| | | | | | | | 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>
* keyboard: pad key translation tableTianhao Wang2024-06-11
| | | | | | | | 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>
* fix io blocking bug in kbdctlTianhao Wang2024-06-11
|
* cgascr: refactoringTianhao Wang2024-06-11
|
* move io.rs into submoduleTianhao Wang2024-06-11
|
* choreTianhao Wang2024-06-11
|
* rename wraper -> vectorTianhao Wang2024-06-11
|
* choreTianhao Wang2024-06-11
|
* linker: "optimize" section arrangementsTianhao Wang2024-06-11
| | | | | | | 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"
* interrupt: add rust binding for idtTianhao Wang2024-06-11
|
* formatting codeTianhao Wang2024-06-11
|
* split idt and vectors from startup codeTianhao Wang2024-06-11
|
* choreTianhao Wang2024-06-11
|
* interrupt: rename `guardian` to `interrupt_gate`Tianhao Wang2024-06-11
|
* mask keyboard interrupt while polling keyTianhao Wang2024-06-11
|
* mask interrupt during handler routineTianhao Wang2024-06-11
|
* remove plugbox moduleTianhao Wang2024-06-11
|
* pic: initialize with rust codeTianhao Wang2024-06-11
|
* chore lintingTianhao Wang2024-06-11
|
* cgascr: init cursor in rust codeTianhao Wang2024-06-11
|
* re-organize codeTianhao Wang2024-06-11
|
* keyboard: implement leds and rebootTianhao Wang2024-06-11
| | | | works on qemu, untested on real machine
* thredding 1/?Tianhao Wang2024-06-11
|
* fix bug in cga driverTianhao Wang2024-06-11
|
* paging: add basic bitmap frame allocatorTianhao Wang2024-06-11
|
* chore: make clippy happyTianhao Wang2024-06-11
|
* define memory layout (if there was a layout)Tianhao Wang2024-06-11
|
* add mm and ds modules (yet empty)Tianhao Wang2024-06-11
|
* MM: add modules for memory managementTianhao Wang2024-06-11
|
* PS/2 Keyboard controller: read and decode keyTianhao Wang2024-06-11
|
* PS/2 Keyboard controller: baselineTianhao Wang2024-06-11
|
* add IOPort structTianhao Wang2024-06-11
| | | | So that device IO can be be synchronized.
* keyctl: use bitflags for key modifiersTianhao Wang2024-06-11
| | | | Merge key modifier getters and setters
* make device_io a arch independent interface.Tianhao Wang2024-06-11
| | | | | In arm we will be using MMIO instead of the IO instructions. However the peripherals should use the same interface for IOs.
* basic interrupt/PIC supportTianhao Wang2024-06-11
|
* pub(crate) use for println macrosTianhao Wang2024-06-11
| | | | | | 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...
* add println! and panic! macroTianhao Wang2024-02-01
| | | | | 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.
* use inline asm for x86 IO instrTianhao Wang2024-02-01
|
* Allow dead_code and unused_imports at crate levelTianhao Wang2024-02-01
| | | | | | 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... :(
* formatting code, use tab identation -- before it's too lateTianhao Wang2024-01-30
|
* minimal support for keyctrl, not completeTianhao Wang2023-03-24
|
* usable printf, with some ptr magicTianhao Wang2023-03-15
|
* add delay between IOsTianhao Wang2023-03-14
|