Working on booting on nixOS
This commit is contained in:
parent
2744e8e67b
commit
ad22051a20
|
@ -2,5 +2,5 @@ TODO:
|
|||
Support cache drives
|
||||
|
||||
# Compiling
|
||||
1. `git submodule --update init`
|
||||
1. `git submodule update --init`
|
||||
1. `cargo repbuild`
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
(module
|
||||
(data "mouse")
|
||||
(data "x")
|
||||
(data "y")
|
||||
(func $rma (import "host" "read_mem_addr")(param i32)(result i32))
|
||||
(func $co (import "host" "create_object")(param i32 i32)(result i64))
|
||||
(func $roa (import "host" "read_object_attribute")(param i64 i32 i32)(result i32 i32))
|
||||
(memory (export "memory") 1)
|
||||
|
||||
(func
|
||||
(export "start")(result i64)
|
||||
;; Copy into memory the object name
|
||||
(memory.init 0
|
||||
(i32.const 0) ;; target offset
|
||||
(i32.const 0) ;; source offset
|
||||
(i32.const 5))
|
||||
(memory.init 1
|
||||
(i32.const 6) ;; target offset
|
||||
(i32.const 0) ;; source offset
|
||||
(i32.const 1))
|
||||
(memory.init 2
|
||||
(i32.const 7) ;; target offset
|
||||
(i32.const 0) ;; source offset
|
||||
(i32.const 1))
|
||||
|
||||
i32.const 0
|
||||
i32.const 5
|
||||
call $co
|
||||
|
||||
;; i32.const 6
|
||||
;; i32.const 1
|
||||
|
||||
;; call $roa
|
||||
|
||||
)
|
||||
)
|
|
@ -9,6 +9,7 @@
|
|||
prelude_import,
|
||||
ptr_sub_ptr
|
||||
)]
|
||||
#![deny(clippy::pedantic)]
|
||||
#![no_std]
|
||||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(crate::test_runner)]
|
||||
|
|
|
@ -155,10 +155,6 @@ fn run(release: bool, target: Target) -> Result<(), Error> {
|
|||
if target == Target::X86_64 {
|
||||
#[rustfmt::skip]
|
||||
com.args([
|
||||
|
||||
|
||||
|
||||
|
||||
"-bios",
|
||||
std::env::var("REPBUILD_QEMU_FIRMWARE_PATH")
|
||||
.as_deref()
|
||||
|
|
42
shell.nix
Normal file
42
shell.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ pkgs ? import <nixpkgs> { } }:
|
||||
pkgs.mkShell rec {
|
||||
buildInputs = with pkgs; [
|
||||
clang
|
||||
llvmPackages.bintools
|
||||
rustup
|
||||
qemu_full
|
||||
# OMVFFull
|
||||
# OMVF
|
||||
];
|
||||
extraCmds = '''';
|
||||
|
||||
|
||||
RUSTC_VERSION = pkgs.lib.readFile ./rust-toolchain.toml;
|
||||
# https://github.com/rust-lang/rust-bindgen#environment-variables
|
||||
LIBCLANG_PATH =
|
||||
pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ];
|
||||
shellHook = ''
|
||||
export REPBUILD_QEMU_FIRMWARE_PATH=$(find -O3 /* -name OVMF_CODE.fd 2>/dev/null | head -n 1)
|
||||
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
|
||||
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
|
||||
'';
|
||||
# Add precompiled library to rustc search path
|
||||
RUSTFLAGS = (builtins.map (a: "-L ${a}/lib") [
|
||||
# add libraries here (e.g. pkgs.libvmi)
|
||||
]);
|
||||
# Add glibc, clang, glib and other headers to bindgen search path
|
||||
BINDGEN_EXTRA_CLANG_ARGS =
|
||||
# Includes with normal include path
|
||||
(builtins.map (a: ''-I"${a}/include"'') [
|
||||
# add dev libraries here (e.g. pkgs.libvmi.dev)
|
||||
pkgs.glibc.dev
|
||||
])
|
||||
# Includes with special directory paths
|
||||
++ [
|
||||
''
|
||||
-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"''
|
||||
''-I"${pkgs.glib.dev}/include/glib-2.0"''
|
||||
"-I${pkgs.glib.out}/lib/glib-2.0/include/"
|
||||
];
|
||||
|
||||
}
|
12
system.toml
12
system.toml
|
@ -1,4 +1,6 @@
|
|||
[boot]
|
||||
# This package must be installed system wide
|
||||
init = "init_server"
|
||||
[boot.limine]
|
||||
default_entry = 1
|
||||
timeout = 0
|
||||
|
@ -18,14 +20,10 @@ resolution = "1024x768x24"
|
|||
[repositories]
|
||||
core = "https://git.ablecorp.us/AbleOS/core"
|
||||
userspace = "https://git.ablecorp.us/AbleOS/ableos_userland"
|
||||
nya = "https://git.ablecorp.us/AbleOS/nya"
|
||||
|
||||
|
||||
[packages]
|
||||
[packages.list_files]
|
||||
version = "0.1.1"
|
||||
[packages.init_server]
|
||||
version = "1.0"
|
||||
hash = ""
|
||||
repo = "userspace"
|
||||
authors = []
|
||||
|
||||
[packages.list_files.configuration]
|
||||
repo = "core"
|
||||
|
|
Loading…
Reference in a new issue