-
Notifications
You must be signed in to change notification settings - Fork 13
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
[WIP] Arch independence #183
Open
roblabla
wants to merge
15
commits into
sunriseos:master
Choose a base branch
from
roblabla:arch-independence
base: master
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
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
Orycterope
requested changes
Jan 30, 2019
dependencies = ["kernel-linker", "install-rust-src"] | ||
command = "cargo" | ||
args = ["xbuild", "--target=i386-unknown-none", "--package=kfs-kernel", "--release" ] | ||
args = ["xbuild", "--target=${TARGET}", "--package=kfs-kernel", "-Z", "package-features", "--features=panic-on-exception", "${RELEASE_FLAG}"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
panic-on-exception is a debug feature, it shouldn't be enabled when building for release ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I guess I'll add a KERNEL_FLAGS
env variable.
roblabla
force-pushed
the
arch-independence
branch
from
February 21, 2019 18:48
cb06523
to
04f628e
Compare
- Instead of duplicating rules for debug and release, we instead use profiles to determine whether we should build in Debug or Relase mode. We do this by adding two global env variables (TARGET_PATH and RELEASE_FLAG). TARGET_PATH should contain the PATH relative to target/ where we can find the compiled binaries. RELEASE_FLAG should contain --release in release mode, and a noop flag under debug mode. We use --message-format=human as a noop flag. - We also support building for different targets using the TARGET environment variable, which defaults to i386-unknown-none.
Start refactoring the i386 module into an architecture abstraction module. The arch module should export functions abstracting common operations across multiple architectures, and expose a module containing the architecture-specific functionality. For now, the architecture abstraction API contains two functions: - enable_interrupts, which allow hardware to call event::dispatch_event - disable_interrupts, which tells hardware to queue interruptions.
The stub arch is a noop architecture where all the functions do nothing. It's mostly meant to be used as a centralized place for the documentation of the arch abstraction API, but can also be used for tests and easily bootstrapping a port to a new architecture.
Adds two new functions to the arch abstraction API: get_cmdline and get_logger. Those are used by the log implementation to find the serial device to log to, and the log configuration.
The syscall module is moved to the root, making documentation better (syscalls is right on kfs_kernel project page). Fixes sunriseos#54. The rest of the interrupts module is fully arch-specific, so it is moved under arch::i386.
start and common_start are both architecture-specific, so move them under arch::i386. Furthermore, init the multiboot2 global as early as possible, and make frame_allocator take the multiboot2 information with `get_boot_information` function.
Adds a new function: force_logger_unlock, which force-unlocks any Mutex that might be protecting the logger. This is only used in the panic implementation, in order to avoid deadlocking. Panic now uses get_logger in order to stay arch-generic.
Adds two new function and one structure to the arch abstraction API: - ThreadHardwareContext, contains some support fields for the process switching code. - process_switch: Executes another process. - prepare_for_first_schedule: Prepare a new thread to get scheduled/switched to.
Adds a new trait: `elf_loader::Module`, representing a kernel builtin that will be loaded when booting the kernel. Adds a new function to arch abstraction API: get_modules(). This function returns an iterator of `Module`s. All of those modules are to be started on kernel boot.
Adds a new type in arch-generic API, KernelStack, and a new function, dump_stack. KernelStack represents the Kernel Stack used to handle interruptions associated with a ThreadStruct. Having KernelStack in the arch-generic API is a bit weird. The concept is inherently arch-dependent...
A few simple improvements to set_bits_area: - It is now available to both BitField and BitArray - It now uses RangeBounds, allowing the use of inclusive ranges, partial ranges, and full ranges. - It now has tests.
for_each_region is similar to for_each_entry, but runs for each contiguous region in the same "state". It is effectively the logic used by dump_kernelland_state, ripped in a generic function.
Make the frame allocator atomic. This allows allocating frames from multiple CPU cores without having to go through a global lock.
roblabla
force-pushed
the
arch-independence
branch
from
February 21, 2019 19:14
04f628e
to
1e1c481
Compare
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.
For future AArch64 compatibility