Compare commits
2 commits
3d53b641bf
...
d958a103fa
Author | SHA1 | Date | |
---|---|---|---|
koniifer | d958a103fa | ||
koniifer | ee82bc5705 |
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -228,12 +228,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.git#7058efe75c7ad245db80986e77a97d426b9be8a4"
|
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#baa70d3f1272c2cbb208ca17115dc54b7d31af5c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hblang"
|
name = "hblang"
|
||||||
version = "0.1.0"
|
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 = [
|
dependencies = [
|
||||||
"hashbrown 0.15.1",
|
"hashbrown 0.15.1",
|
||||||
"hbbytecode",
|
"hbbytecode",
|
||||||
|
@ -245,7 +245,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hbvm"
|
name = "hbvm"
|
||||||
version = "0.1.0"
|
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 = [
|
dependencies = [
|
||||||
"hbbytecode",
|
"hbbytecode",
|
||||||
]
|
]
|
||||||
|
@ -428,9 +428,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.162"
|
version = "0.2.163"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398"
|
checksum = "1fdaeca4cf44ed4ac623e86ef41f056e848dbeab7ec043ecb7326ba300b36fd0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "limine"
|
name = "limine"
|
||||||
|
|
|
@ -11,11 +11,9 @@ static mut LAPIC: LocalApic = unsafe { MaybeUninit::zeroed().assume_init() };
|
||||||
static mut IDT: InterruptDescriptorTable = unsafe { MaybeUninit::zeroed().assume_init() };
|
static mut IDT: InterruptDescriptorTable = unsafe { MaybeUninit::zeroed().assume_init() };
|
||||||
|
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(Debug)]#[derive(Eq, Hash, PartialEq)]
|
#[derive(Debug, Eq, Hash, PartialEq)]
|
||||||
|
|
||||||
|
pub enum Interrupt {
|
||||||
pub
|
|
||||||
enum Interrupt {
|
|
||||||
Timer = 32,
|
Timer = 32,
|
||||||
ApicErr = u8::MAX - 1,
|
ApicErr = u8::MAX - 1,
|
||||||
Spurious = u8::MAX,
|
Spurious = u8::MAX,
|
||||||
|
@ -64,7 +62,7 @@ extern "x86-interrupt" fn page_fault(
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "x86-interrupt" fn timer(_isf: InterruptStackFrame) {
|
extern "x86-interrupt" fn timer(_isf: InterruptStackFrame) {
|
||||||
interrupt(Interrupt::Timer);
|
// interrupt(Interrupt::Timer);
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
LAPIC.end_of_interrupt();
|
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;
|
use crate::arch::INTERRUPT_LIST;
|
||||||
let il = INTERRUPT_LIST.lock();
|
let il = INTERRUPT_LIST.lock();
|
||||||
let val = il.list.get(&interrupt_type).unwrap();
|
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;
|
use crate::holeybytes::kernel_services::service_definition_service::sds_search_service;
|
||||||
let buffer = sds_search_service(val);
|
let buffer = sds_search_service(val);
|
||||||
if buffer != 0 {
|
if buffer != 0 {
|
||||||
use alloc::vec::Vec;use crate::kmain::IPC_BUFFERS;
|
use {crate::kmain::IPC_BUFFERS, alloc::vec::Vec};
|
||||||
let mut buffs = IPC_BUFFERS.lock();
|
let mut buffs = IPC_BUFFERS.lock();
|
||||||
match buffs.get_mut(&buffer) {
|
match buffs.get_mut(&buffer) {
|
||||||
Some(buff) => {
|
Some(buff) => {
|
||||||
let mut msg_vec = Vec::new();
|
let mut msg_vec = Vec::new();
|
||||||
msg_vec.push(0xff);
|
msg_vec.push(0xFF);
|
||||||
buff.push(msg_vec.to_vec());
|
buff.push(msg_vec.to_vec());
|
||||||
log::debug!("Sent Message {:?} to Buffer({})", msg_vec, buffer);
|
log::debug!("Sent Message {:?} to Buffer({})", msg_vec, buffer);
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
log::error!("Access of non-existent buffer {}", buffer)
|
log::error!("Access of non-existent buffer {}", buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// log::info!("{}", buffer);
|
|
||||||
|
|
||||||
|
// log::info!("{}", buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
|
@ -6,7 +6,7 @@ $uninit := fn($Expr: type): ?Expr {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
dangling := fn($Expr: type): ^Expr {
|
$dangling := fn($Expr: type): ^Expr {
|
||||||
return @bitcast(@alignof(Expr))
|
return @bitcast(@alignof(Expr))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ alloc := fn($Expr: type, num: uint): ^Expr {
|
||||||
ptr := request_page(MAX_ALLOC)
|
ptr := request_page(MAX_ALLOC)
|
||||||
remaining := pages - MAX_ALLOC
|
remaining := pages - MAX_ALLOC
|
||||||
loop if remaining < MAX_ALLOC break else {
|
loop if remaining < MAX_ALLOC break else {
|
||||||
_ = request_page(@intcast(MAX_ALLOC))
|
_ = request_page(MAX_ALLOC)
|
||||||
remaining -= MAX_ALLOC
|
remaining -= MAX_ALLOC
|
||||||
}
|
}
|
||||||
_ = request_page(@intcast(remaining))
|
_ = request_page(@intcast(remaining))
|
||||||
|
|
|
@ -25,7 +25,6 @@ example := fn(): void {
|
||||||
render.clear(screen, render.black)
|
render.clear(screen, render.black)
|
||||||
render.put_filled_circle(screen, .(screen.width / 2, screen.height / 2), 128, render.light_yellow)
|
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)
|
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, 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.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)
|
render.sync(screen)
|
||||||
|
|
Loading…
Reference in a new issue