forked from AbleOS/ableos
add an example system.toml
This commit is contained in:
parent
01cdd68b28
commit
174b621acd
28
README.md
28
README.md
|
@ -1,26 +1,2 @@
|
|||
# ableOS
|
||||
![Discord](https://img.shields.io/discord/831368967385120810) ![Code Size](https://img.shields.io/github/languages/code-size/abletheabove/ableos)
|
||||
## 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
|
||||
TODO:
|
||||
Support cache drives
|
|
@ -1,17 +1,21 @@
|
|||
use spin::Lazy;
|
||||
use x86_64::{
|
||||
structures::{
|
||||
gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector},
|
||||
tss::TaskStateSegment,
|
||||
use {
|
||||
spin::Lazy,
|
||||
x86_64::{
|
||||
structures::{
|
||||
gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector},
|
||||
tss::TaskStateSegment,
|
||||
},
|
||||
VirtAddr,
|
||||
},
|
||||
VirtAddr,
|
||||
};
|
||||
|
||||
pub const DOUBLE_FAULT_IX: u16 = 0;
|
||||
|
||||
pub unsafe fn init() {
|
||||
use x86_64::instructions::segmentation::{Segment, CS, SS};
|
||||
use x86_64::instructions::tables::load_tss;
|
||||
use x86_64::instructions::{
|
||||
segmentation::{Segment, CS, SS},
|
||||
tables::load_tss,
|
||||
};
|
||||
|
||||
log::info!("Initialising GDT");
|
||||
GDT.0.load();
|
||||
|
@ -23,7 +27,7 @@ pub unsafe fn init() {
|
|||
struct Selectors {
|
||||
kcode: SegmentSelector,
|
||||
kdata: SegmentSelector,
|
||||
tss: SegmentSelector,
|
||||
tss: SegmentSelector,
|
||||
}
|
||||
|
||||
static TSS: Lazy<TaskStateSegment> = Lazy::new(|| {
|
||||
|
@ -45,7 +49,7 @@ static GDT: Lazy<(GlobalDescriptorTable, Selectors)> = Lazy::new(|| {
|
|||
let sels = Selectors {
|
||||
kcode: gdt.add_entry(Descriptor::kernel_code_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)
|
||||
});
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
use crate::arch::hardware_random_u64;
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt::{self, Formatter};
|
||||
use {
|
||||
crate::arch::hardware_random_u64,
|
||||
alloc::vec::Vec,
|
||||
core::fmt::{self, Formatter},
|
||||
};
|
||||
#[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)]
|
||||
pub struct OSHandle {
|
||||
pub id: u64,
|
||||
|
@ -19,14 +21,14 @@ impl OSHandle {
|
|||
|
||||
#[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)]
|
||||
pub struct Handle {
|
||||
id: OSHandle,
|
||||
id: OSHandle,
|
||||
perms: Permissions,
|
||||
}
|
||||
|
||||
impl Handle {
|
||||
pub fn new() -> Handle {
|
||||
Handle {
|
||||
id: OSHandle::random_new(),
|
||||
id: OSHandle::random_new(),
|
||||
perms: Permissions::new(),
|
||||
}
|
||||
}
|
||||
|
@ -46,13 +48,13 @@ impl fmt::Display for Handle {
|
|||
#[derive(PartialEq, Hash, Eq, Debug, Clone, Copy)]
|
||||
|
||||
pub struct Permissions {
|
||||
edit_children: bool,
|
||||
edit_children: bool,
|
||||
edit_attributes: bool,
|
||||
}
|
||||
impl Permissions {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
edit_children: true,
|
||||
edit_children: true,
|
||||
edit_attributes: true,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
use alloc::vec;
|
||||
use alloc::vec::Vec;
|
||||
use {
|
||||
alloc::vec::Vec,
|
||||
spin::{Lazy, Mutex},
|
||||
};
|
||||
|
||||
use spin::{Lazy, Mutex};
|
||||
// Seperate use statement
|
||||
use alloc::vec;
|
||||
|
||||
pub type HostObjects = Vec<Option<xml::XMLElement>>;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ ${ABLEOS_KERNEL}=boot:///kernel
|
|||
# TODO: Make a boot background image for ableOS
|
||||
|
||||
DEFAULT_ENTRY=1
|
||||
TIMEOUT=0
|
||||
TIMEOUT=50
|
||||
VERBOSE=yes
|
||||
INTERFACE_RESOLUTION=1024x768
|
||||
# Terminal related settings
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
hex_literal_case = "Upper"
|
||||
imports_granularity = "One"
|
||||
struct_field_align_threshold = 5
|
||||
|
|
31
system.toml
Normal file
31
system.toml
Normal 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]
|
Loading…
Reference in a new issue