Skip to content
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
wants to merge 15 commits into
base: master
Choose a base branch
from

Commits on Feb 21, 2019

  1. Configuration menu
    Copy the full SHA
    dc46324 View commit details
    Browse the repository at this point in the history
  2. Makefile: support multiple targets, use profiles for debug/release

    - 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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    56960dd View commit details
    Browse the repository at this point in the history
  3. Kernel: move i386 module to arch::i386

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    bc9cba4 View commit details
    Browse the repository at this point in the history
  4. Add stub arch for documentation and tests.

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    f5be039 View commit details
    Browse the repository at this point in the history
  5. Kernel: arch abstraction API for cmdline and logs

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    37d1cc9 View commit details
    Browse the repository at this point in the history
  6. Move interrupts to arch::i386 and syscalls to root

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    9d8c5f9 View commit details
    Browse the repository at this point in the history
  7. Kernel: Move startup functions to 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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    c6ad3a4 View commit details
    Browse the repository at this point in the history
  8. Kernel: Use arch abstraction API in panic handling.

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    515bff1 View commit details
    Browse the repository at this point in the history
  9. Kernel: Use arch abstraction API for process switching

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    4348c14 View commit details
    Browse the repository at this point in the history
  10. Kernel: Get kernel builtins through arch abstraction API

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    4a07c7f View commit details
    Browse the repository at this point in the history
  11. Kernel: Move stack allocation/dumping in arch-generic API

    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...
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    2fe3fdd View commit details
    Browse the repository at this point in the history
  12. set_bits_area improvements

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    6b56161 View commit details
    Browse the repository at this point in the history
  13. Kernel: new PageTable for_each_region function

    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.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    be937df View commit details
    Browse the repository at this point in the history
  14. Kernel: Atomic frame allocator

    Make the frame allocator atomic. This allows allocating frames from
    multiple CPU cores without having to go through a global lock.
    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    0fc6147 View commit details
    Browse the repository at this point in the history
  15. Temporary commit

    roblabla committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    1e1c481 View commit details
    Browse the repository at this point in the history