Michael Shaw
3e6592b0f3
proc.h: add semaphore for process
2024-06-11 22:54:26 -04:00
Michael Shaw
20e25dad40
block: link child partitions to parent bdev
2024-03-02 00:35:50 -05:00
Michael Shaw
5f00dac0ea
sched: add kernel API for blocking processes
2024-02-19 02:27:03 -05:00
Michael Shaw
0f5da3c539
vfs: eliminte writes to NULL error code pointers
2024-02-12 23:59:56 -05:00
Michael Shaw
8721d1968b
slab: add krealloc
2024-02-07 22:31:08 -05:00
Michael Shaw
a10509f1e5
lib: move lib headers into lib directory
2024-01-30 22:00:20 -05:00
Michael Shaw
070af3aba0
fs: reorginize memory allocations and frees
2024-01-30 00:09:56 -05:00
Michael Shaw
e2ea205129
proc: hack in special file descriptors
...
The previos commit broke executions of all program files due to a NULL
memory access when inserting special file descriptors. This will be
replaced when some sort of /dev fs is implemented
2024-01-24 18:49:06 -05:00
Michael Shaw
c1287cecef
proc: add state for blocking process
2023-11-29 19:50:30 -05:00
Michael Shaw
874e63e41c
tty: add stubs for console_write and console_read
2023-11-29 19:37:04 -05:00
Michael Shaw
0297f4a34c
syscall: imeplement basic file IO syscalls
...
also fix a bug where the RAX register would be restored to its initial
state instead of carrying the syscall return value
2023-11-27 02:48:52 -05:00
Michael Shaw
3dda839cdd
syscall: implement write syscall
2023-11-22 23:27:39 -05:00
Michael Shaw
aac47e60f3
proc: free pages and fds after proc termination
2023-11-22 21:55:52 -05:00
Michael Shaw
83731d6eab
proc: slab allocate proc structs
2023-11-22 21:29:15 -05:00
Michael Shaw
f8b801236a
vfs: remove kernel file descriptor numbers
2023-11-22 21:09:05 -05:00
Michael Shaw
18bcf40094
vfs: remove old vfs.h file
2023-11-22 20:48:23 -05:00
Michael Shaw
271d9a1fea
elf: correctly load data segment
2023-11-22 20:15:24 -05:00
Michael Shaw
0a0235612e
syscall: change handling of exceptions and traps
2023-11-21 19:19:35 -05:00
Michael Shaw
37518aea81
usr: implement user process switching
...
This is a rather large commit, so the gist of it is this:
User context switching is now functional, after a change to the TSS, and
a few minor details in the scheduler and loader.
ELF parsing is rather primitive, but basically functional, as long as it
only loads code.
The interrupt 0x80 is for syscalls, and will switch from user mode to
kernel mode. It is currently the only interrupt that can be called from
user mode
This adds the syscall functionality, which currently uses a red-black
tree to store the function pointers, although when the table is more
flushed out, it will probably be replaced with an array
The pager now correctly marks the parent nodes with attributes as it
allocates them. Without doing this, the page table entries will never be
reached in lower privilege modes, causing page faults
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
2023-11-20 22:07:35 -05:00
Michael Shaw
d60da85470
load: add basic elf loading
2023-11-16 23:22:27 -05:00
Michael Shaw
ec4d266abd
ahci: relocate ahci_vbase to unmapped region
2023-11-15 20:16:21 -05:00
Michael Shaw
823f811954
mmap: generalize mmap
...
also add a range search function to ensure that memory allocations do
not overlap in virtual space
2023-11-15 16:56:29 -05:00
Michael Shaw
fdb319e96b
paging: move paging from buddy.c into new file
2023-11-15 15:41:48 -05:00
Michael Shaw
a85be6eb62
elf: add basic elf parsing
2023-11-15 12:50:46 -05:00
Michael Shaw
884cd19f5b
sched: add process states
2023-11-13 23:47:54 -05:00
Michael Shaw
2c3b7be962
sched: save registers and IRETQ frame on IRQ
2023-11-13 22:37:19 -05:00
Michael Shaw
2fe0b0068b
sched: begin scheduling module
2023-11-13 22:23:06 -05:00
Michael Shaw
06b02fc9a6
kmalloc: add fallback for failed DMA allocations
2023-11-03 14:43:53 -04:00
Michael Shaw
36c6f7b92c
boot: print list of block devices on mount fail
2023-11-01 19:55:44 -04:00
Michael Shaw
e7ceff19ec
gdt: increase GDT size
2023-11-01 17:47:09 -04:00
Michael Shaw
2c88b77edd
init: correct TSS impl, generalize stack loading
2023-11-01 17:43:27 -04:00
Michael Shaw
c2daea8b18
gdt: add TSS entries for application processors
2023-11-01 15:55:29 -04:00
Michael Shaw
1cf54c7fd3
panic: add panic function
...
also remove print messages from APIC driver
2023-10-27 22:41:10 -04:00
Michael Shaw
4dc4f07dc6
mem: improve device memory mapping
...
MMIO ports will no longer directly map to HHDM addresses and will need
to be searched for in the memory mapping tree
2023-10-24 22:16:33 -04:00
Michael Shaw
0029621ada
cmd: add initial commands ls and help
2023-10-20 23:56:01 -04:00
Michael Shaw
ecf517d7b5
mem: add genrw to mem.h
2023-10-20 13:35:43 -04:00
Michael Shaw
25a828437a
fs: move fs init into kernel cmdline
...
Previously, any partition with an ext2 filesystem would be mounted by
the gpt header parser. With this patch, the kernel cmdline `root=val` is
responsible for mounting the root filesystem.
2023-10-19 11:08:54 -04:00
Michael Shaw
aeb2781baf
common: add errno to common include
2023-10-18 20:39:02 -04:00
Michael Shaw
f8ea51441e
add error checking for ext2 superblock read
2023-10-18 13:44:05 -04:00
Michael Shaw
f8124e4b78
ext2: add ability to read inodes
2023-06-26 00:11:39 -04:00
Michael Shaw
21e2540243
block: replace block_part with independent block devices
...
this also removes the fat32 support for now, as the virtual filesystem
needs more work
2023-05-27 17:32:39 -04:00
Michael Shaw
db5990cc97
mem: add locks to kernel memory management structures
2023-05-27 02:11:27 -04:00
Michael Shaw
8e6d0d4fbc
kernel: add support for basic type spinlock_t
...
A spinlock is the most basic type of lock. It will attempt to acquire,
and upon failure, will continue attempting indefinitely until it is
successful.
2023-05-27 01:44:33 -04:00
Michael Shaw
13437a219e
page: do not invalidate kernel TLB entries
...
set the PAGE_GLOBAL attr for kernel pages
2023-05-23 23:23:10 -04:00
Michael Shaw
29a0435cf6
slab: replace struct slab with slab_t
...
This type should never be modified by the user, and only passed into the
functions in slab.c. Using a typedef to notifies the user semantically
of this fact
2023-05-19 16:49:34 -04:00
Michael Shaw
05c528f64c
block: read GPT header from block devices on init
2023-05-13 23:04:15 -04:00
Michael Shaw
82c32011b4
rbtree: fix previously flawed implementation
...
got book'd up
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
2023-05-11 12:51:14 -04:00
Michael Shaw
ea1c1b337d
rbt: remove verify function
2023-05-10 21:57:40 -04:00
Michael Shaw
c712f0a7d6
kmalloc: add consistency test when KDEBUG is defined
2023-05-10 21:41:25 -04:00
Michael Shaw
4e36cfd90b
lib: add rbtree data structure
...
This also switches the kmalloc allocator over to the new rbtree
structure. As a balanced binary search tree, it is much more efficient
than the previous method
2023-05-10 21:24:19 -04:00