-
Notifications
You must be signed in to change notification settings - Fork 121
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
310551038 lab5–8 #127
Open
abt8601
wants to merge
51
commits into
oscapstone:310551038
Choose a base branch
from
abt8601:310551038
base: 310551038
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
310551038 lab5–8 #127
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
The consistency checks were meant to guarantee the correct operation of the kernel by making sure that everything is loaded into the memory in a sensible way (e.g. the memory region used by the kernel doesn't overlap with other reserved regions). However, they make the code convoluted. Given that the probability of something being incorrectly loaded is exceedingly low in practice, it makes more sense not to include these checks. The quicksort implementation remains in the source tree, albeit becoming unused.
Other changes: - Properly handle critical sections in memory allocators. - Fixes a bug in the dynamic memory allocator that causes memory corruption. - Disable page frame allocator debug log.
Other changes: - Scheduler: - Partial rewrite to simplify design. - The current thread no longer remains on the run queue after being scheduled. - Serial console: - Redesign around non-blocking primitives. - Add new non-blocking functions. - Add read/write readiness notification facility. - Dynamic memory allocator: - Fix a bug in `free` that causes the incorrect slot to be freed. - (Old) User program: - Retired. Superseded by the current scheduler. - Testers: - Retire `xcpt_test` since it no longer works. - Add `syscall_test` that tests some system calls. - Add a minimal libc. TODO: - Properly implement red-black tree in order to speed up the process of finding a process by its PID.
Other changes: - Scheduler: - Disable user stack sharing by default. - Fix `get_process_by_id` and `kill_all_processes`. - System call: - Change the return values of `sys_mbox_call` to match the video player. - Main function: - Remove scheduler test code.
The default exception handler now starts a kernel panic instead of returning. This aids in debugging by avoiding cluttering the serial console due to repeated triggering of the same exception.
Other changes: - Adjust text width in the default exception handler. TODO: - Fix the release build.
- User-space memory is now mapped as normal memory instead of device memory. - Kernel memory now disallows non-privileged access.
`sys_mbox_call` now copies the mailbox buffer into the kernel before calling `mailbox_call`. This is because it is generally unsafe to pass the user-space buffer directly, since it may be discontinuous physically.
Other changes: - Disable demand paging/CoW debug log. - Fix a bug in `free` that causes an incorrect slot to be freed.
Fix a bug in `free` that causes an incorrect slot to be freed. Backported from 8a64b30.
Other changes: - Add a workaround for a run queue corruption but that causes terminated threads to be scheduled.
Other changes: - Fix a bug in `_vm_drop_page_table` (called by `vm_drop_addr_space`) that causes memory leak by not freeing pages.
`deliver_signal` depends on the invariant that, if the `is_waiting` status bit is set on a thread, then that thread must be in a wait queue. However, when waking up a thread from a wait queue, the `is_waiting` status bit was not correctly cleared, causing `deliver_signal` to corrupt the run queue.
`shared_page_decref` used to dereference null pointers when called on a non-shared page.
Other changes: - Fix memory leaks in `_tmpfs_create` and `_tmpfs_mkdir`.
Other changes: - Fix syscall number checking in `xcpt_svc_handler`.
Other changes: - Move `SEEK_*` constants around. - Properly handle setup errors in `vfs_mount`. - Add missing `static`s.
- Stops assuming that the number of sectors per cluster is 1. - Fix memory leak in `_sd_fat32_read`. - Slightly clean up `_sd_fat32_read`. - Remove useless code in `_sd_fat32_lseek64`. - Adds component name check in `_sd_fat32_lookup`. - Stops assuming that directories live in 1 cluster.
- Fix file size update in `_sd_fat32_write`. - `_sd_fat32_write` now persists the file size update in the SD card. - Fix directory entries used for LFN being overwritten in `_sd_fat32_create_impl`. - Fix directory table persistence using the wrong LBA in `_sd_fat32_create_impl`.
Implements block-level caching, which covers FAT caching and file content caching. Metadata caching (both FS-level and file-level) and the component name cache have been implemented, accidentally, by the previous commits. Also fixes signal handling due to a wrong system call number for the `sys_sigreturn` system call.
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.
Self-Check
0816171 lab0
Description
This PR completes labs 5–8. Namely, the following are completed:
Everything runs on a real machine.
TODO
Bug Fixes
Fix run queue corruption that causes terminated threads to be scheduled.Optional Features
Others