Commit Graph

956 Commits

Author SHA1 Message Date
Bananymous 65501837b7 Kernel: Stack trace dumping validates pointers before using them 2023-08-31 21:36:23 +03:00
Bananymous 3ed0a54847 Update README.md 2023-08-31 17:54:12 +03:00
Bananymous cbd2519b9a Kernel: better handle kernel errors 2023-08-29 00:13:21 +03:00
Bananymous e8a73f9696 BuildSystem: use -a with rsync
This allows cmake to not rebuild whole project every time
2023-08-28 11:38:17 +03:00
Bananymous 1a0d114861 LibC: Don't undef needed values in inttypes.h 2023-08-24 15:48:14 +03:00
Bananymous 5c3497681e BuildSystem: Add USES_TERMINAL when preparing sysroot
You were not able to enter sudo password on sysroot unpacking,
which caused ninja to hang
2023-08-23 20:48:40 +03:00
Bananymous b05cf9ef09 BuildSystem: Base sysroot is now distributed as a tar ball
This allows file and directory permissions work as intended.

cmake is now filled with 'sudo' but with sudo timeout this should be
fine.
2023-08-23 10:38:21 +03:00
Bananymous a74eb357a1 Shell: hostname is not parsed from /etc/hostname 2023-08-23 10:38:21 +03:00
Bananymous 8eb71084f0 Shell: use process groups more properly 2023-08-22 14:54:50 +03:00
Bananymous ef1077fd7b Kernel: kill() with negative pid actually matches pgid 2023-08-22 14:54:15 +03:00
Bananymous f1ba5c7e0f Kernel: Process keeps track if forked process has called exec*() 2023-08-22 14:53:46 +03:00
Bananymous 97ea4986af Kernel/LibC: implement proper getpgid and setpgid 2023-08-22 14:53:12 +03:00
Bananymous 25c021c15b Kernel: Add function to enumerate processes in session 2023-08-22 14:52:28 +03:00
Bananymous 2bf12a52d1 BAN: increase function size to 5 * sizeof(void*) 2023-08-22 14:52:03 +03:00
Bananymous 6ada36d3cb Shell/init: We now use pgrp instead of pid and init open terminal 2023-08-22 11:37:04 +03:00
Bananymous 42b90ae76c Kernel/LibC: Add {get,set}pgrp() 2023-08-22 11:36:33 +03:00
Bananymous ccc61cb10c Kernel: Barebones implementation sessions and process groups 2023-08-22 11:35:40 +03:00
Bananymous be5b81740e BAN: Add enum class Iteration for for_each loops 2023-08-22 11:30:53 +03:00
Bananymous e7458ca10a BAN: Function call is now const 2023-08-22 11:30:40 +03:00
Bananymous b10168eb1c LibC: make printf buffer only 128 bytes
Only reason for it to be big is if you want super large zero padding
for your number. This will eventually be handled without the buffer.
2023-08-18 16:49:27 +03:00
Bananymous 30463c9082 Id: Print username corresponding to uid/euid
Also print euid and egid if they differ from uid or gid.
2023-08-18 15:36:51 +03:00
Bananymous dc7391dc89 BuildSystem: only apply stack usage warning to libc 2023-08-17 20:49:52 +03:00
Bananymous eb98d70a0b Shell: command execution and parsing support piped commands
There is still problems with "blocking" builtin commands (time),
return value, ...
2023-08-17 12:05:38 +03:00
Bananymous dcd8374b89 LibC: add fileno() and fdopen()
fdopen() doesn't currently care about mode and will have same mode
as the underlying file descriptor.
2023-08-17 12:03:59 +03:00
Bananymous 8e4216215e Kernel/LibC: add dup() syscall and function 2023-08-17 12:03:29 +03:00
Bananymous 5bd7099b96 Shell: add basic printf test 2023-08-16 10:49:34 +03:00
Bananymous 9a63d3b2da LibC: printf handles nan and inf 2023-08-16 10:49:34 +03:00
Bananymous bf02330db9 LibC: math.h defines is*() macros and uses builtins for values 2023-08-16 10:41:55 +03:00
Bananymous 5806a6484f cat: use 1025 buffer. this allows reads to be 1024 byte
reading from disk currently returns ENOTSUP if buffer size is not
multiple of sector size.
2023-08-16 09:33:14 +03:00
Bananymous 0fa5401800 Shell: $? returns last return value 2023-08-15 09:17:46 +03:00
Bananymous b30f4cbfb5 Userspace: Add basic whoami command 2023-08-15 09:03:51 +03:00
Bananymous ba37183c9c Shell: '\u' in PS1 is replaced with username corresponding to euid 2023-08-14 14:55:23 +03:00
Bananymous 2f298a1979 Shell: ^A moves cursor to the beginning of line 2023-08-14 12:26:22 +03:00
Bananymous 8c282a5d83 Kernel: O_SEARCH doesn't require any permissions
Except read permissions for all directories in the path

This allows us to stat e.g. device files for which we don't have
the permissions.
2023-08-11 12:26:07 +03:00
Bananymous d34c0a5abe LibC: cleanup fstatat 2023-08-11 12:25:15 +03:00
Bananymous 8f3348cf2b Kernel: open() now validates file access mode 2023-08-11 11:53:38 +03:00
Bananymous 38c0bc7bae Kernel: Remove unused syscall 2023-08-11 11:43:48 +03:00
Bananymous 313b00b11f Userspace: implement basic stat
I tried to format the output pretty much how linux does, except for
uid and git -> name resolution which is not implemented
2023-08-11 10:30:50 +03:00
Bananymous 165a379c73 LibC: Fix S_IF* macros and add macros for access/type masks 2023-08-11 10:30:50 +03:00
Bananymous a7f37236bf Kernel: Zero initialize threads sse_storage 2023-08-11 00:26:43 +03:00
Bananymous 51532336b0 Kernel: Move structures in boot.S to .data section 2023-08-11 00:26:12 +03:00
Bananymous 03d4b47f63 Kernel: HPET is now used in legacy mode when PIC is forced 2023-08-10 22:01:30 +03:00
Bananymous 8b57edde6b Kernel: Fix slave PIC
we dont mask interrupt 2 in PIC since it corresponds to the
slave PIC. Also cleanup PIC code :)
2023-08-10 21:52:31 +03:00
Bananymous 778778fede Kernel: HPET doesn't use the legacy mapping anymore 2023-08-10 21:08:32 +03:00
Bananymous f7449c4ab9 Kernel: APIC now uses MMIO namespace functions for mmio 2023-08-10 21:07:23 +03:00
Bananymous fd2bcc9156 Kernel: IDT now sends EOI for every interrupt
EOI is sent before calling the interrupt handler. This should be fine
since all interrupts are processed with interrupts disabled
2023-08-09 09:57:02 +03:00
Bananymous a5b1555725 Kernel: Validate HPET tick period 2023-08-09 09:50:38 +03:00
Bananymous e74fdbc55b Kernel: Remove get_unix_timestamp from SystemTimer
Kernel now uses the percise real_time() and time_since_boot()
2023-08-09 08:57:50 +03:00
Bananymous 008c777a9f Kernel: Add PageTable::Flags::CacheDisable
Also fix multiple places where we were using uint8_t as page table
flags instead of PageTable::flags_t which we promoted to uint16_t
while back.
2023-08-06 23:59:30 +03:00
Bananymous d8a9d4a24e Kerne: SystemTimer can now output the current real time 2023-08-04 16:06:47 +03:00