-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor and Bug Fixes for both Libc and Kernel #114
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… pipe management in VFS. - Enhanced `sys/types.h` with `nlink_t`, `blksize_t`, and `blkcnt_t` types for file metadata. - Modified `vfs_close` and `procfs_close` for error handling and memory management with pipe references. - Updated `assert.c` to use `pr_emerg` for assertion messages and enhanced debugging format. - Extended `tests` to include pipe tests, `t_pipe_child.c` and `t_pipe_single.c`.
…hey are either full or empty... that is not fixed, yet.
…e. Add pipe test.
…itself. Clean up the code.
- No more shouting about empty or full pipes. - In `pipe_read_wake_function`, we check for absent writers and still wake the sleeping lads. - `pipe_close` now gives a friendly nudge to waiting readers when all writers decide to close-up shop. - Before diving into the fray of read and write operations, we now check if there’s data or space, making our code cleaner than an Ork's battle axe after a good fight. - Introduced a workaround for blocking calls—it's not pretty, but it gets the job done like a 'eavy metal squig! Waaagh! Pipes are now more reliable than a grot with a slingshot!
…seful, so it got the chop.
…t have been issues with using `outportb` to QEMU serial in user-space, so it was replaced with the more standard syslog method. Turns out, in the future `syslog` is gona be da boss!
…ile initializing ATA. - Created vfs_dump_superblocks function, a sneaky dumper ta show off dem superblocks for easy inspectin'. - Fixed some debug messages in ATA.
… microsecond counts, ensuring no ticks get left behind.
…p to bad numbers.
- Add new data structures. - Rename size to aligned_object_size in slab.
…t2_dealloc_cache`. Stopped scribblin' on dodgy pointers-da cache be safe now!
…mproved logging, and resource cleanup. Added checks for NULL pointers, underflows, and inconsistent states. Updated slab allocation, refill, and destruction logic to ensure robustness; no more dodgy inputs sneakin' by.
…IR. Improved log clarity by showing full source paths, making it easier to differentiate between files with identical names across libc and kernel code; no more guessin' where da problem's comin' from.
…ng, ensured robust path handling. Da path be clear now, boss.
- Replaced _syscallN macros with explicit function implementations, ensuring clear naming and direct use of __inline_syscall_N. - Standardized function styles with consistent __syscall_return handling. - Updated syscall wrappers across unistd, sys, and other libc modules for easier maintenance and extensibility. - Fixed formatting issues and streamlined error handling for a cleaner implementation. - Disable `mmap` and `munmap`. On `kernel` side: - Improved parameter descriptions and return value docs for better clarity across files. - Simplified and standardized debug logging by removing redundant function names. - Added a fget utility in process.c for easier file descriptor retrieval. - Enhanced sys_mmap in paging.c to validate file sizes and fetch stats before mapping. - Refactored syscall_handler for streamlined argument handling, removing unused 6-argument support. - Tweaked VFS and pipe operations with better naming and structural improvements, da pipes are flowin’ proppa now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor and Bug Fixes for both Libc and Kernel
Changes
Libc
_syscallN
macros with explicit function implementations, ensuring clear naming and direct use of__inline_syscall_N
.__syscall_return
handling.unistd
,sys
, and other libc modules for easier maintenance and extensibility.mmap
andmunmap
functionalities.Kernel
fget
utility inprocess.c
for easier file descriptor retrieval.sys_mmap
inpaging.c
to validate file sizes and fetch stats before mapping.syscall_handler
for streamlined argument handling, removing unused 6-argument support.Logging
CMAKE_SOURCE_DIR
for improved clarity and debugging.timer
).assert.c
to usepr_emerg
for assertion messages, improving debugging formats.Pipes
pipe
system call andpipe_inode_info_t
structure for pipe management in VFS.pipe_read
,pipe_write
, andpipe_close
reliability, handling edge cases like absent writers and waiting readers.pipe_read_wake_function
to ensure proper behavior for readers when writers are absent.t_pipe_child.c
andt_pipe_single.c
.Error Handling
slab.c
with additional input validation, improved logging, and resource cleanup.ext2_dealloc_cache
to ensure stability and safety.__RELATIVE_PATH__
macro and resolved Clang warnings for robust path handling.sys_nanosleep
to return0
instead of-1
.Testing
Bug Fixes
nanosleep
to prevent incorrect snoozing.signal.c
to clean up log outputs.get_current_interrupt_stack_frame
).Miscellaneous
vfs_dump_superblocks
function for easier inspection of superblocks.size
toaligned_object_size
for clarity.interval
andvalue
to microseconds, ensuring accuracy.init
process to the runqueue before initialization for improved startup behavior.ext2
caching issues to prevent invalid memory access.syslog
and debug outputs in several areas to streamline code.