Compare commits

...

2 commits

Author SHA1 Message Date
koniifer d958a103fa fix 2024-11-16 09:34:17 +00:00
koniifer ee82bc5705 minor changes 2024-11-16 09:30:53 +00:00
4 changed files with 26 additions and 33 deletions

10
Cargo.lock generated
View file

@ -228,12 +228,12 @@ dependencies = [
[[package]]
name = "hbbytecode"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#7058efe75c7ad245db80986e77a97d426b9be8a4"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#baa70d3f1272c2cbb208ca17115dc54b7d31af5c"
[[package]]
name = "hblang"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#7058efe75c7ad245db80986e77a97d426b9be8a4"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#baa70d3f1272c2cbb208ca17115dc54b7d31af5c"
dependencies = [
"hashbrown 0.15.1",
"hbbytecode",
@ -245,7 +245,7 @@ dependencies = [
[[package]]
name = "hbvm"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#7058efe75c7ad245db80986e77a97d426b9be8a4"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#baa70d3f1272c2cbb208ca17115dc54b7d31af5c"
dependencies = [
"hbbytecode",
]
@ -428,9 +428,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.162"
version = "0.2.163"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398"
checksum = "1fdaeca4cf44ed4ac623e86ef41f056e848dbeab7ec043ecb7326ba300b36fd0"
[[package]]
name = "limine"

View file

@ -11,11 +11,9 @@ static mut LAPIC: LocalApic = unsafe { MaybeUninit::zeroed().assume_init() };
static mut IDT: InterruptDescriptorTable = unsafe { MaybeUninit::zeroed().assume_init() };
#[repr(u8)]
#[derive(Debug)]#[derive(Eq, Hash, PartialEq)]
#[derive(Debug, Eq, Hash, PartialEq)]
pub
enum Interrupt {
pub enum Interrupt {
Timer = 32,
ApicErr = u8::MAX - 1,
Spurious = u8::MAX,
@ -64,7 +62,7 @@ extern "x86-interrupt" fn page_fault(
}
extern "x86-interrupt" fn timer(_isf: InterruptStackFrame) {
interrupt(Interrupt::Timer);
// interrupt(Interrupt::Timer);
unsafe {
LAPIC.end_of_interrupt();
@ -85,8 +83,7 @@ extern "x86-interrupt" fn spurious(_: InterruptStackFrame) {
}
}
fn interrupt(interrupt_type: Interrupt){
fn interrupt(interrupt_type: Interrupt) {
use crate::arch::INTERRUPT_LIST;
let il = INTERRUPT_LIST.lock();
let val = il.list.get(&interrupt_type).unwrap();
@ -94,23 +91,20 @@ fn interrupt(interrupt_type: Interrupt){
use crate::holeybytes::kernel_services::service_definition_service::sds_search_service;
let buffer = sds_search_service(val);
if buffer != 0 {
use alloc::vec::Vec;use crate::kmain::IPC_BUFFERS;
let mut buffs = IPC_BUFFERS.lock();
match buffs.get_mut(&buffer) {
Some(buff) => {
let mut msg_vec = Vec::new();
msg_vec.push(0xff);
buff.push(msg_vec.to_vec());
log::debug!("Sent Message {:?} to Buffer({})", msg_vec, buffer);
}
None => {
log::error!("Access of non-existent buffer {}", buffer)
}
}
// log::info!("{}", buffer);
use {crate::kmain::IPC_BUFFERS, alloc::vec::Vec};
let mut buffs = IPC_BUFFERS.lock();
match buffs.get_mut(&buffer) {
Some(buff) => {
let mut msg_vec = Vec::new();
msg_vec.push(0xFF);
buff.push(msg_vec.to_vec());
log::debug!("Sent Message {:?} to Buffer({})", msg_vec, buffer);
}
None => {
log::error!("Access of non-existent buffer {}", buffer)
}
}
// log::info!("{}", buffer);
}
}
}

View file

@ -6,7 +6,7 @@ $uninit := fn($Expr: type): ?Expr {
return null
}
dangling := fn($Expr: type): ^Expr {
$dangling := fn($Expr: type): ^Expr {
return @bitcast(@alignof(Expr))
}
@ -23,7 +23,7 @@ alloc := fn($Expr: type, num: uint): ^Expr {
ptr := request_page(MAX_ALLOC)
remaining := pages - MAX_ALLOC
loop if remaining < MAX_ALLOC break else {
_ = request_page(@intcast(MAX_ALLOC))
_ = request_page(MAX_ALLOC)
remaining -= MAX_ALLOC
}
_ = request_page(@intcast(remaining))

View file

@ -25,7 +25,6 @@ example := fn(): void {
render.clear(screen, render.black)
render.put_filled_circle(screen, .(screen.width / 2, screen.height / 2), 128, render.light_yellow)
render.put_circle(screen, .(screen.width / 2, screen.height / 2), 256, render.light_blue)
// Precision issues?
render.put_textured_circle(screen, able, .(able.width / 2, able.height / 2), .(screen.width / 2 + @intcast(@fti(sin(angle) * 256)), screen.height / 2 + @intcast(@fti(cos(angle) * 256))), able.width / 2 - 1)
render.put_textured_circle(screen, mini, .(mini.width / 2, mini.height / 2), .(screen.width / 2 + @intcast(@fti(sin(angle + PI) * 256)), screen.height / 2 + @intcast(@fti(cos(angle + PI) * 256))), mini.width / 2 - 1)
render.sync(screen)