Commit Graph

988 Commits

Author SHA1 Message Date
7afbff08b6 apps: Add a little screen utility
It tells you the resolution of your screen :)
2022-11-02 21:00:23 +01:00
249c79f8a3 Kernel, libc: Add ioctl()
Right now, only the framebuffer supports this system call, to query its dimensions.
2022-11-02 20:59:42 +01:00
feab66c0d3 Kernel: Remove the paint() system call
That was a very old one from back in the old days. Now that the framebuffer is finally a device file,
and it can be memory-mapped by user programs for more performance,
this syscall is MORE than obsolete.
2022-11-02 20:35:06 +01:00
8f2308c80d Kernel: Implement mmap-able device files (regular files are not mmap-able yet) 2022-11-02 20:24:07 +01:00
42a805fd60 Kernel: Move the translated keyboard to /dev/console and make /dev/kbd provide raw scancodes 2022-11-02 19:51:54 +01:00
c604c074a1 Kernel: Rename ASSERT() to ensure()
Doesn't get stripped on release builds, so it shouldn't be named assert.
2022-11-02 19:38:15 +01:00
e5cf32c7b3 Kernel: Introduce page ownership
Some pages, such as framebuffer pages, are not physical memory frames reserved for the current process.
Some, such as the framebuffer, may be shared between all processes.
Yet, on exit() or on exec(), a process frees all frames mapped into its address spaces.
And on fork(), it copies all data between frames. So how could we map framebuffers.

Simple: we use one of the bits in page table entries which are available to the OS, and mark whether that page is owned by the current process.

If it is owned, it will be:
- Freed on address space destruction
- Its data will be copied to a new page owned by the child process on fork()

If it is not owned, it will be:
- Left alone on address space destruction
- On fork(), the child's virtual page will be mapped to the same physical frame as the parent

This still needs a bit more work, such as keeping a reference of how many processes use a page to free it when all processes using it exit/exec.
This should be done for MAP_SHARED mappings, for example, since they are not permanent forever,
unlike the framebuffer for example.
2022-11-02 19:32:28 +01:00
875d971d3b Tools: Make list-ports.sh exit when ports.list does not exist 2022-11-02 18:53:47 +01:00
dfcc827103 libc: Add PROT_EXEC 2022-11-02 18:40:05 +01:00
07e518c38f Kernel: Make sys_mmap log the correct prot value 2022-11-02 18:39:58 +01:00
22740e69bf Kernel: Add support for the NX bit
Not support, actually. We now REQUIRE it.
2022-11-02 18:34:57 +01:00
534500cda0 Implement enough runtime for binutils to compile 2022-10-31 12:29:53 +01:00
497a52dd82 apps: add a little mkdir utility 2022-10-31 09:53:52 +01:00
c2a08060cf VFS: Add support for an implementation-defined value 2022-10-30 20:53:45 +01:00
5eae93bbb0 Bugfix: do not crash if we are blocking for no reason 2022-10-30 20:51:32 +01:00
aabff7a1d3 libc: Add mktime() 2022-10-30 20:46:25 +01:00
45f40a31d6 Remove old FIXME 2022-10-30 20:40:53 +01:00
f83c78bcad libc: Implement gettimeofday() and instantly mark it as deprecated 2022-10-30 20:40:05 +01:00
7bd1cba1e3 libc: Stub out bsearch() 2022-10-30 20:02:03 +01:00
52d4f34f05 Kernel, libc: Implement umask() 2022-10-30 19:55:38 +01:00
0d443385e9 libc: Add system() 2022-10-30 19:43:37 +01:00
29c59abf7d Kernel: Rename blocking_wait_info's wait_pid to pid 2022-10-30 19:28:43 +01:00
9c3792718c Kernel: Remove waitpid() debug messages and add more checks 2022-10-30 19:24:56 +01:00
e244c150c2 Kernel, libc: Add ECHILD 2022-10-30 19:24:26 +01:00
c68d040484 Scheduler: Make sure we are in the kernel's address space when resuming a blocked process 2022-10-30 19:10:46 +01:00
a7e4f2bdd2 sh: Make it much more versatile
This commit implements:
Argument matching, to show help and version
Support for running scripts
Support for parsing and running commands (via -c)

This is the first step to implementing the system() libc function.
2022-10-30 19:09:18 +01:00
e58aa361c8 sh: Show message when child called abort() 2022-10-30 18:36:52 +01:00
00f90246c8 Kernel: Implement very basic escape sequences for TextRenderer 2022-10-30 18:34:40 +01:00
08c4dac2c2 Kernel: Enable -Wvla 2022-10-30 18:20:16 +01:00
b4ccd786f9 remove-port.sh: export DESTDIR 2022-10-30 18:19:12 +01:00
97df9d8d3a Ports: Add nasm port 2022-10-30 18:14:57 +01:00
948361bec5 printf: Show which format specifier is unknown 2022-10-30 18:08:29 +01:00
d186d573dd libc: Document strftime in time.h 2022-10-30 17:48:54 +01:00
d5a6c7f27f libc: Implement strftime() 2022-10-30 17:47:47 +01:00
4c096bd36c uptime: break time down into more understandable units
80 seconds -> 1 minute, 20 seconds for example
647 seconds would be 10 minutes, 47 seconds
and more...
2022-10-30 10:31:59 +01:00
af0f4d2037 Kernel: Remove /dev/uptime
This information can now be fetched with clock_gettime.
2022-10-30 10:16:53 +01:00
6df5b8a703 Make backspace work 2022-10-30 10:08:52 +01:00
e640c6e245 Kernel, libc, userspace: Add file timestamps (atime,ctime,mtime) 2022-10-30 09:57:17 +01:00
8d46c9bbe2 Kernel, libc: Fix a big bug in printf()
Every time printf flushes the buffer to us in sprintf() or snprintf(), we call strncat to append the data.

But we want to start from the beginning in the first flush. What if there was data already there?
Well, we just append to the old data. Which is not good, and breaks snprintf()'s maximum size policy.

This fix sets the first byte of str to NULL, to avoid this.
2022-10-30 09:53:23 +01:00
e705810af3 apps: Add a new date utility
This program tells you the current date and time :)
2022-10-30 09:09:24 +01:00
e2b5c1bfdd uptime: Use clock_gettime instead of reading from /dev/uptime 2022-10-30 09:09:03 +01:00
324fb42ee2 libc: Add support for the new time functionality in the kernel 2022-10-30 09:08:29 +01:00
688a640a16 Kernel: Add the clock_gettime syscall, which replaces clock as it can be used for more stuff 2022-10-30 09:07:59 +01:00
baf97840e9 Kernel: Keep track of boot time 2022-10-30 09:07:03 +01:00
a9da58421f su: do not pass out-of-bounds argv to execv when argc is 1 2022-10-29 20:13:40 +02:00
d1e4bc5504 Kernel: Use framebuffer virtual address instead of physical address
Just found out bootboot.fb_ptr was the physical address, not virtual.
That explains why we were getting page faults while writing to the physical address of the framebuffer. (we were in a user address space when doing so)
So this should probably make the system much more stable!!
2022-10-29 20:10:49 +02:00
8395eb16f6 session: endpwent on exit 2022-10-29 10:18:39 +02:00
7aad256acd Update README.md 2022-10-29 10:13:36 +02:00
33ed6e5c17 su: endpwent on exit 2022-10-29 10:01:51 +02:00
8375701bf6 session, su: Split password-collecting logic into a separate function 2022-10-29 10:01:44 +02:00