594d79143e
Kernel: enable -Wconversion
2022-10-06 17:13:34 +02:00
952d8fa294
Be more strict with warnings
2022-10-05 17:34:22 +02:00
560b0a1705
libc: Rename the _ folder to bits, as used internally by libraries
2022-10-04 19:11:54 +02:00
48b858af5a
libc: Add strncpy and strncat, and deprecate strcpy and strcat (which, since we're building with -Werror, is an instant ban from using these functions)
2022-10-04 19:08:59 +02:00
a050ed9133
libc: add an internal macros.h header with headers to make attributes less verbose
2022-10-04 19:06:56 +02:00
c6ed8d2abb
libc: remove duplicate declaration of strcpy
2022-10-04 18:59:13 +02:00
3bfdad7a75
Kernel: Remove outdated rule in Makefile
2022-10-04 18:52:02 +02:00
25928a2a8d
Kernel: Always build config.cpp, even when it's not modified
2022-10-04 18:46:10 +02:00
7a998dda4d
Kernel: Do not stop interrupts by default in the interrupt handler
...
I always knew you can choose if interrupts are enabled for a specific ISR in the IDT entry, but at some moment there was a bug and I thought maybe that fixed it. Now reverting that doesn't break anything, so... let's do it :)
2022-10-04 18:45:46 +02:00
8f310dd307
PMM: Map the page bitmap to kernel heap once the PMM and VMM are both initialized
2022-10-04 18:36:09 +02:00
5d8b825659
Add a few example apps/demos in C, and make the kernel choose a random one to demonstrate every boot
2022-10-03 21:24:38 +02:00
885e39f60f
libc: fix printf to actually print correct more-than-one-digit numbers (hint: the bugfix was a very stupid one)
2022-10-03 20:30:12 +02:00
cb60e418b2
Add vprintf, (v)sprintf and (v)snprintf to libc + move the non v-printfs to stdio.cpp, since they can now call their v-variants and thus don't depend on internal_printf
2022-10-03 19:59:33 +02:00
9420484c9b
Do not use __builtin_alloca in puts (could overflow the stack for large strings)
2022-10-03 19:05:04 +02:00
34aa953dbc
Add printf() and puts(), quite primitive, looks like hex printing isn't there yet...
2022-10-03 19:00:10 +02:00
fc9868819f
Moon 0.9-dev
2022-10-02 21:19:49 +02:00
dae2ff8d50
Add mmap and munmap syscalls, and thus, add malloc and free to libc!! (yet again, thanks to the wonderful liballoc)
2022-10-02 20:45:04 +02:00
ee31a3458d
Fix setup-binutils and setup-gcc
2022-10-02 19:58:52 +02:00
db9e1ba17c
Add a memclr() SSE-optimized function
2022-10-02 19:13:33 +02:00
38470724dc
Scheduler: adjust SSE saving conditions
2022-10-02 19:13:21 +02:00
1ecd24f5d6
Kernel: Add SSE support (enable SSE on boot and save context (user tasks only) on task switch)
2022-10-02 18:53:54 +02:00
d2f9e17c86
Use __luna_abort in init
2022-10-02 18:16:27 +02:00
ae95a528f2
Make function stubs in libc loudly abort instead of silently failing
2022-10-02 18:10:53 +02:00
8e6741ebd6
Rename SYS_version to SYS_getversion
2022-10-02 17:25:56 +02:00
c6b044acab
ELFLoader: show permissions of loadable segment
2022-10-02 17:10:24 +02:00
3c6c94adda
Add a proper syscall() function to unistd.h
2022-10-02 17:02:15 +02:00
83d23ce8fe
Correct the syscall ABI
2022-10-02 17:01:46 +02:00
6bacded5cf
Update build system
2022-10-02 17:01:30 +02:00
e483f6d1e6
Adjust build scripts to install LibC headers
2022-10-02 12:47:50 +02:00
f8a72f15c8
Adjust build system to be more flexible and to work with the new toolchain
2022-10-02 12:44:32 +02:00
ba52e389a5
Hosted GCC cross-compiler for x86_64-luna!!!
2022-10-02 12:21:02 +02:00
dc0fd428d3
Syscalls return a value, right?
2022-10-02 10:47:59 +02:00
85d4268b01
Hosted Binutils for x86_64-luna
2022-10-02 10:33:34 +02:00
fcf5923cc0
WIP: Add a C Library, let's try to compile a Hosted GCC cross-compiler using this!
2022-10-01 20:59:22 +02:00
c76ecdf07c
Moon 0.8-dev
2022-10-01 17:35:10 +02:00
c7f46f96ff
Use the new syscalls in init
2022-10-01 17:32:50 +02:00
ac6fdce737
Add 2 new syscalls (sys_version, sys_gettid)
2022-10-01 17:30:31 +02:00
96f53922c9
Write a (kindof) proper init, at least with the capabilities we have right now
2022-10-01 15:54:42 +02:00
ba4806f9d3
Syscall: do not send user programs' output to the serial console
2022-10-01 15:53:55 +02:00
87cb41e549
Separate the logging stack into toggleable backends, to disable console logging once boot finishes.
2022-10-01 15:35:11 +02:00
0e46ea8ada
Finally, a text renderer that actually works. We can now see the kernel messages without a serial port :)
2022-10-01 14:27:45 +02:00
cde850258d
Don't assume we are located at /bin/init
2022-10-01 13:16:59 +02:00
008bdf505c
Rename gfx.cpp to paint.cpp
2022-10-01 13:09:43 +02:00
30411b4b78
Fix hackiness in converting a uint32_t to a Color, by providing a function to do so
2022-10-01 13:08:47 +02:00
03db57bbf9
Sanity checks
2022-10-01 12:32:09 +02:00
66bee86a8b
Scheduler: add a load_user_task function that directly loads a file from the initrd
2022-10-01 12:28:32 +02:00
1c4383dea4
Add an apps/ folder and build-system to build userspace apps which can now be loaded from the initrd
2022-10-01 12:17:16 +02:00
9012ccc49e
Remove _userspace and move the idle task to assembly
2022-10-01 12:16:30 +02:00
6e6cf5b2b0
Add an ELF Loader!!
2022-10-01 12:15:56 +02:00
53d36be339
Add a much-needed get_blocks_from_size function
2022-10-01 12:13:38 +02:00