Merge branch 'master' into chore/refactor-device-info
This commit is contained in:
commit
c955f3a0de
BIN
AAVMF_CODE.fd
Normal file
BIN
AAVMF_CODE.fd
Normal file
Binary file not shown.
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -859,12 +859,12 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hbbytecode"
|
name = "hbbytecode"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.ablecorp.us/ableos/holey-bytes#75995422262a192f2c87713d239856e98c799f41"
|
source = "git+https://git.ablecorp.us/ableos/holey-bytes#6a444bd29ea6d474ec98edbc11b27030825b86e2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hbvm"
|
name = "hbvm"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.ablecorp.us/ableos/holey-bytes#75995422262a192f2c87713d239856e98c799f41"
|
source = "git+https://git.ablecorp.us/ableos/holey-bytes#6a444bd29ea6d474ec98edbc11b27030825b86e2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"delegate",
|
"delegate",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
|
|
|
@ -20,8 +20,11 @@ TODO
|
||||||
- PS/2 Keyboard driver
|
- PS/2 Keyboard driver
|
||||||
- VGA driver
|
- VGA driver
|
||||||
- SVGA driver
|
- SVGA driver
|
||||||
- File system
|
- File system
|
||||||
|
TarFS
|
||||||
|
Pass in a tar file as an initrd and parse it with TarFS
|
||||||
- VFS
|
- VFS
|
||||||
|
Being (written)[https://git.ablecorp.us/bee/ableos-vfs] by Bee
|
||||||
- Disk driver
|
- Disk driver
|
||||||
- A ton more
|
- A ton more
|
||||||
```
|
```
|
||||||
|
|
11
arm.sh
Executable file
11
arm.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
qemu-system-aarch64 -m 1024 -cpu cortex-a57 \
|
||||||
|
-M virt -pflash "AAVMF_CODE.fd" \
|
||||||
|
-device virtio-gpu-pci \
|
||||||
|
-device virtio-mouse-device \
|
||||||
|
-device virtio-keyboard-device \
|
||||||
|
-kernel limine/BOOTX64.EFI
|
||||||
|
# -device virtio-serial-pci \
|
||||||
|
# -drive if=none,file=target/disk.img,id=hd0 \
|
||||||
|
# -device virtio-blk-device,drive=hd0
|
||||||
|
|
||||||
|
# -kernel target/aarch64-virt-ableos/debug/kernel
|
|
@ -4,7 +4,6 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
bootmodules::{build_cmd, BootModules},
|
bootmodules::{build_cmd, BootModules},
|
||||||
capabilities,
|
|
||||||
device_tree::DeviceTree,
|
device_tree::DeviceTree,
|
||||||
scheduler::Scheduler,
|
scheduler::Scheduler,
|
||||||
},
|
},
|
||||||
|
@ -38,10 +37,10 @@ pub fn kmain(cmdline: &str, boot_modules: BootModules) -> ! {
|
||||||
// TODO: schedule the filesystem driver from the initramfs
|
// TODO: schedule the filesystem driver from the initramfs
|
||||||
// TODO: schedule the init system from the initramfs
|
// TODO: schedule the init system from the initramfs
|
||||||
|
|
||||||
capabilities::example();
|
// capabilities::example();
|
||||||
|
|
||||||
let mut sched = Scheduler::new();
|
let mut sched = Scheduler::new();
|
||||||
// AHEM that isn't a valid HBVM program
|
|
||||||
sched.new_process(boot_modules[0].bytes.clone());
|
sched.new_process(boot_modules[0].bytes.clone());
|
||||||
sched.new_process(boot_modules[1].bytes.clone());
|
sched.new_process(boot_modules[1].bytes.clone());
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,29 @@ impl Scheduler<'_> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut prog = self.data.pop_front().unwrap();
|
let mut prog = self.data.pop_front().unwrap();
|
||||||
prog.run().unwrap();
|
let ret = prog.run();
|
||||||
|
match ret {
|
||||||
|
Ok(oki) => match oki {
|
||||||
|
hbvm::vm::VmRunOk::End => {
|
||||||
|
log::info!(
|
||||||
|
"Program ended. {} programs remaining.",
|
||||||
|
// Add one here because we pop a program
|
||||||
|
self.data.len() + 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
hbvm::vm::VmRunOk::Timer => {
|
||||||
|
log::info!("Timer exhausted. Scheduled program");
|
||||||
|
self.data.push_back(prog);
|
||||||
|
}
|
||||||
|
hbvm::vm::VmRunOk::Ecall => {
|
||||||
|
// panic!();
|
||||||
|
log::info!("{:?}", prog.registers);
|
||||||
|
self.data.push_back(prog);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// log::info!("VM registers {:?}", prog.registers);
|
Err(_) => {}
|
||||||
log::info!("Scheduled program");
|
}
|
||||||
self.data.push_back(prog);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
repbuild/holeybytes/ecall.hb
Normal file
BIN
repbuild/holeybytes/ecall.hb
Normal file
Binary file not shown.
BIN
repbuild/holeybytes/inf_loop.hb
Normal file
BIN
repbuild/holeybytes/inf_loop.hb
Normal file
Binary file not shown.
Binary file not shown.
|
@ -21,5 +21,5 @@ TERM_BACKDROP=008080
|
||||||
MODULE_PATH=boot:///inf_loop.hb
|
MODULE_PATH=boot:///inf_loop.hb
|
||||||
MODULE_CMDLINE="diskid=123456789"
|
MODULE_CMDLINE="diskid=123456789"
|
||||||
|
|
||||||
MODULE_PATH=boot:///inf_loop.hb
|
MODULE_PATH=boot:///ecall.hb
|
||||||
MODULE_CMDLINE=""
|
MODULE_CMDLINE=""
|
|
@ -122,10 +122,15 @@ fn get_fs() -> Result<FileSystem<impl ReadWriteSeek>, io::Error> {
|
||||||
&mut fs.root_dir().create_file("background.bmp")?,
|
&mut fs.root_dir().create_file("background.bmp")?,
|
||||||
)?;
|
)?;
|
||||||
io::copy(
|
io::copy(
|
||||||
&mut File::open("repbuild/inf_loop.hb")?,
|
&mut File::open("repbuild/holeybytes/inf_loop.hb")?,
|
||||||
&mut fs.root_dir().create_file("inf_loop.hb")?,
|
&mut fs.root_dir().create_file("inf_loop.hb")?,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
io::copy(
|
||||||
|
&mut File::open("repbuild/holeybytes/ecall.hb")?,
|
||||||
|
&mut fs.root_dir().create_file("ecall.hb")?,
|
||||||
|
)?;
|
||||||
|
|
||||||
drop(bootdir);
|
drop(bootdir);
|
||||||
Ok(fs)
|
Ok(fs)
|
||||||
}
|
}
|
||||||
|
@ -224,8 +229,17 @@ fn run(release: bool, target: Target) -> Result<(), Error> {
|
||||||
|
|
||||||
if target == Target::Aarch64 {
|
if target == Target::Aarch64 {
|
||||||
com.args([
|
com.args([
|
||||||
"-M", "virt", "-m", //
|
"-bios",
|
||||||
|
"target/OVMF_CODE.fd",
|
||||||
|
"-M",
|
||||||
|
"virt",
|
||||||
|
"-device",
|
||||||
|
"ramfb",
|
||||||
|
"-m", //
|
||||||
"128M",
|
"128M",
|
||||||
|
//
|
||||||
|
"-drive",
|
||||||
|
"file=target/disk.img,format=raw",
|
||||||
// "-serial", "stdio",
|
// "-serial", "stdio",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue