summaryrefslogtreecommitdiff
path: root/src/kernel/arch
AgeCommit message (Collapse)Author
2024-08-03kernel: send user interrupt on page faultdzwdz
I really should just rename interrupts to something else. This is inspired by Plan9 and meant to make debugging easier, as the dying process can take a stacktrace etc. It kinda sucks that the default handler now depends on fprintf, which is quite a bit of code, but whatever.
2024-08-02kernel/interrupts: use UserRegs in the isr handlerdzwdz
2024-08-02*: use a generic UserRegs type everywhere I'm storing registersdzwdz
mostly inspired by Plan 9's Ureg, probably obvious from the name
2024-07-27kernel: don't use pointer types for registers, add proc_savereturndzwdz
2024-07-25kernel: set up the GDT in assemblydzwdz
This is just for simplicity's sake. I think I could even omit the `movw $TSS, (GdtTss + 2)` and have the linker fill that out as a relocation, but that would probably be more complex overall.
2024-07-22kernel: explicitly store process RIP and RFLAGSdzwdz
Once again, needed for the interrupt return syscall. Seems to have made the kernel slower in timebench?
2024-07-22kernel: use IRET instead of SYSRET for switching into usermodedzwdz
I want to implement a new syscall for returning from "interrupts" (my crappy take on Plan 9's notes / UNIX signals), and I've realized that I can't use SYSRET for that, as it clobbers RCX and R11. This hasn't been an issue so far, as I've only been switching into usermode to return from syscalls, but now I might be switching into it at arbitrary moments (right after an interrupt handler recovers from a page fault, etc). I could make it so I switch between IRET and SYSRET depending on the context, but I don't think it's worth it.
2024-07-22kernel/isr: improve interrupt handling codedzwdz
On the assembly side, ensure the stack frame looks always the same, by pushing a fake "error code" for the interrupts that don't generate one. On the C side, use a struct instead of magic indices into an "array", and make it consistent with the current style.
2024-07-17kernel: make kmalloc accept a numeric "tag" instead of a freeform descriptiondzwdz
This will both let me save space in the allocation header, and make the debugprint more readable.
2024-07-14kernel: make the adhoc VfsQueue queues use ReqQueue insteaddzwdz
I'm still not sure if I should use sys/queue.h for this. But yeah, this is more consistent, and it will also let me switch over to O(1) insertions later on.
2024-07-14kernel: rework postqueuedzwdz
Keeping its old name for now to make things easier for myself. This might just be replaced by sys/queue.h soon.
2024-07-11kernel: start cleaning up VfsRequestdzwdz
* I'm being more strict about the linked list state to hopefully ensure I'm not leaking any references. * vfsreq_create was renamed to vfsreq_dispatchcopy as that name feels more clear. It copies its argument, and dispatches it. * Requests for user backends are now handled more like requests for kernel backends - there's an accept() function that accepts a request.
2024-05-19kernel: implement /dev/bintimedzwdz
2024-05-05net: expose the rtl mac to userland, make the netstack use itdzwdz
2024-05-04kernel/rtl8139: prepare for /dev/eth/macdzwdz
2024-03-13kernel/malloc: slight rework (it's still bad), store more metadatadzwdz
2024-03-13kernel/amd64: print debugging info on NMIdzwdz
the vm isn't getting an NMI for any real reason anyways, so I might as well abuse it
2023-09-29kernel: fix linked list iteration in postqueuedzwdz
2023-09-19kernel: use HPET timer for sleepsdzwdz
not strictly necessary, but this should improve: 1. sleep performance 2. power efficiency when idle
2023-09-17kernel/amd64: add HPET support, slightly rework time handlingdzwdz
2023-09-15kern: fix GDT order for 64bit sysretdzwdz
2023-09-13cmd/init: remove /initctl, use intr insteaddzwdz
2023-09-11*: rename /kdev/ to /dev/dzwdz
2023-09-09kernel: gracefully handle no serial portdzwdz
2023-09-09kernel: build /kdev/ on the flydzwdz
2023-09-07kernel: slightly refactor the page allocatordzwdz
2023-09-06boot: compress the init moduledzwdz
2023-09-03misc: remove old debug printsdzwdz
the rtl8139 mac wasn't being read correctly anyways, and the init stuff wasn't revelant in ages. the rest is relatively useful
2023-08-30style: get rid of eprintfdzwdz
2023-08-13kern: undo accidentally commited debug codedzwdz
2023-08-06kernel: put every driver in /kdev/dzwdz
there's no real reason for bootstrap to be doing that, and this brings it closer to only doing the elf loading
2023-06-17kernel: fix procfs overflow bug, add safeguard to prevent similar onesdzwdz
2023-02-23build: don't -Isrc/ in user codedzwdz
2023-02-23fix: misc warningsdzwdz
2023-01-25clean up the repo rootdzwdz
2023-01-25kernel: move /mem/alloc to /malloc and linker.ld to arch/amd64/dzwdz
2023-01-25kernel/driver: consolidate most header files into driver.hdzwdz
2023-01-25kernel/irq: use a lookup table for irqsdzwdz
2023-01-25kernel: consolidate some header filesdzwdz
2023-01-25style: typedef structs, shorter namespacesdzwdz
I've wanted to do this for a while, and since I've just had a relatively large refactor commit (pcpy), this is as good of a time as any. Typedefing structs was mostly inspired by Plan 9's coding style. It makes some lines of code much shorter at basically no expense. Everything related to userland kept old-style struct definitions, so as not to force that style onto other people. I also considered changing SCREAMING_ENUM_FIELDS to NicerLookingCamelcase, but I didn't, just in case that'd be confusing.
2023-01-25kernel/virt: replace the virt_cpy api with a more foolproof onedzwdz
2023-01-24kern/driver/ps2: remove unused functiondzwdz
2022-12-27amd64/ata: poll properlydzwdz
2022-12-26amd64/ata: write supportdzwdz
2022-12-26amd64/ata: refactor the ATA driverdzwdz
2022-09-03driver/ps2,serial: handle all pending reads at the same timedzwdz
2022-09-01kernel: add a debug print for the amount of used memorydzwdz
2022-08-28kernel/amd64: SSE supportdzwdz
2022-08-28kernel/driver: add postqueue_join / postqueue_popdzwdz
2022-08-28kernel/driver: clean up ps2, add the reqpathcmp() macrodzwdz