1
0
Fork 0

add an example system.toml

master
Able 2023-04-26 14:33:40 -05:00
parent e6c8d184d4
commit c723137619
8 changed files with 64 additions and 47 deletions

View File

@ -1,26 +1,2 @@
# ableOS TODO:
![Discord](https://img.shields.io/discord/831368967385120810) ![Code Size](https://img.shields.io/github/languages/code-size/abletheabove/ableos) Support cache drives
## Set up
Install [Qemu](https://www.qemu.org/)
> On Windows be sure to add `C:\Program Files\qemu` to your `PATH` variable
`rustup component add rust-src`
`rustup component add llvm-tools-preview`
`cargo install bootimage`
## Running
repbuild can be used to run and build docs for able os
`cargo repbuild doc`
`cargo repbuild run`
## Testing on real hardware
I recommend using an old x86_64 computer
* `cargo run --release` to generate a binary image that is bootable
* flash it to a USB device via `dd` or balenaEtcher
* Remove said USB device and plug into test machine
* assure test machine boots from USB devices

View File

@ -1,17 +1,21 @@
use spin::Lazy; use {
use x86_64::{ spin::Lazy,
structures::{ x86_64::{
gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector}, structures::{
tss::TaskStateSegment, gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector},
tss::TaskStateSegment,
},
VirtAddr,
}, },
VirtAddr,
}; };
pub const DOUBLE_FAULT_IX: u16 = 0; pub const DOUBLE_FAULT_IX: u16 = 0;
pub unsafe fn init() { pub unsafe fn init() {
use x86_64::instructions::segmentation::{Segment, CS, SS}; use x86_64::instructions::{
use x86_64::instructions::tables::load_tss; segmentation::{Segment, CS, SS},
tables::load_tss,
};
log::info!("Initialising GDT"); log::info!("Initialising GDT");
GDT.0.load(); GDT.0.load();
@ -23,7 +27,7 @@ pub unsafe fn init() {
struct Selectors { struct Selectors {
kcode: SegmentSelector, kcode: SegmentSelector,
kdata: SegmentSelector, kdata: SegmentSelector,
tss: SegmentSelector, tss: SegmentSelector,
} }
static TSS: Lazy<TaskStateSegment> = Lazy::new(|| { static TSS: Lazy<TaskStateSegment> = Lazy::new(|| {
@ -45,7 +49,7 @@ static GDT: Lazy<(GlobalDescriptorTable, Selectors)> = Lazy::new(|| {
let sels = Selectors { let sels = Selectors {
kcode: gdt.add_entry(Descriptor::kernel_code_segment()), kcode: gdt.add_entry(Descriptor::kernel_code_segment()),
kdata: gdt.add_entry(Descriptor::kernel_data_segment()), kdata: gdt.add_entry(Descriptor::kernel_data_segment()),
tss: gdt.add_entry(Descriptor::tss_segment(&TSS)), tss: gdt.add_entry(Descriptor::tss_segment(&TSS)),
}; };
(gdt, sels) (gdt, sels)
}); });

View File

@ -1,6 +1,8 @@
use crate::arch::hardware_random_u64; use {
use alloc::vec::Vec; crate::arch::hardware_random_u64,
use core::fmt::{self, Formatter}; alloc::vec::Vec,
core::fmt::{self, Formatter},
};
#[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)] #[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)]
pub struct OSHandle { pub struct OSHandle {
pub id: u64, pub id: u64,
@ -19,14 +21,14 @@ impl OSHandle {
#[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)] #[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)]
pub struct Handle { pub struct Handle {
id: OSHandle, id: OSHandle,
perms: Permissions, perms: Permissions,
} }
impl Handle { impl Handle {
pub fn new() -> Handle { pub fn new() -> Handle {
Handle { Handle {
id: OSHandle::random_new(), id: OSHandle::random_new(),
perms: Permissions::new(), perms: Permissions::new(),
} }
} }
@ -46,13 +48,13 @@ impl fmt::Display for Handle {
#[derive(PartialEq, Hash, Eq, Debug, Clone, Copy)] #[derive(PartialEq, Hash, Eq, Debug, Clone, Copy)]
pub struct Permissions { pub struct Permissions {
edit_children: bool, edit_children: bool,
edit_attributes: bool, edit_attributes: bool,
} }
impl Permissions { impl Permissions {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
edit_children: true, edit_children: true,
edit_attributes: true, edit_attributes: true,
} }
} }

View File

@ -1,7 +1,10 @@
use alloc::vec; use {
use alloc::vec::Vec; alloc::vec::Vec,
spin::{Lazy, Mutex},
};
use spin::{Lazy, Mutex}; // Seperate use statement
use alloc::vec;
pub type HostObjects = Vec<Option<xml::XMLElement>>; pub type HostObjects = Vec<Option<xml::XMLElement>>;

View File

@ -2,7 +2,7 @@ ${ABLEOS_KERNEL}=boot:///kernel
# TODO: Make a boot background image for ableOS # TODO: Make a boot background image for ableOS
DEFAULT_ENTRY=1 DEFAULT_ENTRY=1
TIMEOUT=0 TIMEOUT=50
VERBOSE=yes VERBOSE=yes
INTERFACE_RESOLUTION=1024x768 INTERFACE_RESOLUTION=1024x768
# Terminal related settings # Terminal related settings

View File

@ -1,2 +1,3 @@
hex_literal_case = "Upper" hex_literal_case = "Upper"
imports_granularity = "One" imports_granularity = "One"
struct_field_align_threshold = 5

31
system.toml Normal file
View File

@ -0,0 +1,31 @@
[boot]
[boot.limine]
default_entry = 1
timeout = 0
verbose = true
interface_resolution = "1024x768x24"
# Terminal related settings
term_wallpaper = "boot:///background.bmp"
term_background = "008080"
[boot.limine.ableos]
comment = "Default AbleOS boot entry."
protocol = "limine"
kernel_path = "boot:///kernel"
kernel_cmdline = "baka=false foobles=true"
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"
hash = ""
repo = "userspace"
authors = []
[packages.list_files.configuration]

BIN
test.wasm

Binary file not shown.