Commit Graph

21 Commits

Author SHA1 Message Date
Bananymous 198dde8365 Kernel: Add klibc for kernel
Now building same source as libc is not needed and libc doesn't
have to do hacks to allow kernel compilation
2024-02-14 15:00:04 +02:00
Bananymous 81689b5f02 LibC: Implement most of missing functions from string.h
only strcoll*, strxfrm* and strerror_l are left unimplemented
2024-02-14 14:39:22 +02:00
Bananymous 2c471a89d0 LibC: Add compile option to libc to stop optimizing string.h 2024-01-17 19:44:29 +01:00
Bananymous 3352640d09 LibC: strlen had to be marked not optimized... 2023-12-19 21:42:59 +02:00
Bananymous 637397dd2f LibC: Make memcpy and memset not optimized
GCC does some weird optimizations and breaks these functions
2023-12-19 21:42:59 +02:00
Bananymous 1cd5b3c20c LibC: Fix stpncpy
I had misunderstood and tought that the string is always
null terminated
2023-12-15 00:33:37 +02:00
Bananymous c4186bd5f0 LibC: Compile with -O2 optimizations
I have no idea why libc had no optimizations enabled.

Weird thing is that memcpy optimized to infinite loop if I kept the
__restrict__ attributes in pointers. I don't think there was any ub.
2023-12-14 23:40:08 +02:00
Bananymous adf1e54605 LibC: Implement more functions to string.h 2023-12-14 11:02:30 +02:00
Bananymous 76049b2e13 LibC: Implement and fix some string.h functions 2023-12-06 18:13:34 +02:00
Bananymous d7a00e8cc2 LibC: Implement stpcpy since gcc seems to need it
gcc seems to optimize some calls to strcpy to stpcpy
2023-09-30 20:58:19 +03:00
Bananymous 1abf787596 LibC: Add errno for unknown error 2023-09-28 12:06:17 +03:00
Bananymous 921d95d18f All: Clear lines with only whitspace in them 2023-09-10 00:31:42 +03:00
Bananymous 297141f321 LibC: add strchrnul()
this is a gnu libc extension
2023-06-11 20:18:03 +03:00
Bananymous 508d6311de LibC: define all errnos and strerror{name,desk}_np 2023-05-11 00:34:03 +03:00
Bananymous 480d92fce5 LibC: add better error string support 2023-05-10 02:22:31 +03:00
Bananymous 054c5450df LibC: syscall() now returns -1 on error and updates errno 2023-05-07 01:51:39 +03:00
Bananymous cd74b2167d LibC: Write mostly functioning stdio 2023-04-23 14:32:37 +03:00
Bananymous aa2aee684b Kernel: remove message from BAN::Error
We don't store the error message anymore in BAN::Error.
Instead we store a error code that can be mapped into a string.
This allows BAN::Error to only take 4 bytes instead of 128.

We should also make some kernel initialization just panic instead
of returning errors since they are required for succesfull boot
anyway.
2023-04-11 23:25:21 +03:00
Bananymous a5830c5424 LibC: add stubs for a lot of functions 2023-04-05 23:58:40 +03:00
Bananymous 67ff01e915 LibC: Add errno ENOTTY 2023-04-05 02:47:37 +03:00
Bananymous d71f1f24e4 LibC: Combine string.h functions definitions to single file 2023-04-02 00:00:29 +03:00