forked from AbleOS/ableos
Merge branch 'master' of https://git.ablecorp.us/AbleOS/ableos
This commit is contained in:
commit
552b613151
|
@ -22,6 +22,7 @@ fatfs = "0.3"
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
hblang = { git = "https://git.ablecorp.us/AbleOS/holey-bytes.git", features = [
|
hblang = { git = "https://git.ablecorp.us/AbleOS/holey-bytes.git", features = [
|
||||||
"std",
|
"std",
|
||||||
|
# "opts",
|
||||||
], default-features = false }
|
], default-features = false }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
raw-cpuid = "11"
|
raw-cpuid = "11"
|
||||||
|
|
|
@ -47,7 +47,6 @@ impl Package {
|
||||||
|
|
||||||
for (count, (name, table)) in bin_table.into_iter().enumerate() {
|
for (count, (name, table)) in bin_table.into_iter().enumerate() {
|
||||||
// if count != 0 {
|
// if count != 0 {
|
||||||
println!("{}", name);
|
|
||||||
binaries.push(name.clone());
|
binaries.push(name.clone());
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
@ -75,6 +74,7 @@ impl Package {
|
||||||
&path,
|
&path,
|
||||||
Options {
|
Options {
|
||||||
fmt: true,
|
fmt: true,
|
||||||
|
// optimize: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
&mut bytes,
|
&mut bytes,
|
||||||
|
@ -83,6 +83,7 @@ impl Package {
|
||||||
hblang::run_compiler(
|
hblang::run_compiler(
|
||||||
&path,
|
&path,
|
||||||
Options {
|
Options {
|
||||||
|
// optimize: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
&mut bytes,
|
&mut bytes,
|
||||||
|
@ -99,6 +100,7 @@ impl Package {
|
||||||
&path,
|
&path,
|
||||||
Options {
|
Options {
|
||||||
dump_asm: true,
|
dump_asm: true,
|
||||||
|
// optimize: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
&mut bytes,
|
&mut bytes,
|
||||||
|
|
|
@ -407,9 +407,9 @@ fn run(release: bool, target: Target, do_accel: bool) -> Result<(), Error> {
|
||||||
"-parallel", "none",
|
"-parallel", "none",
|
||||||
"-monitor", "none",
|
"-monitor", "none",
|
||||||
"-machine", accel,
|
"-machine", accel,
|
||||||
|
"-cpu", "max", "-serial", "stdio",
|
||||||
"-audiodev", "pa,id=speaker",
|
"-audiodev", "pa,id=speaker",
|
||||||
"-machine", "pcspk-audiodev=speaker",
|
"-machine", "pcspk-audiodev=speaker",
|
||||||
"-cpu", "max",
|
|
||||||
"-device", "isa-debug-exit,iobase=0xf4,iosize=0x04",
|
"-device", "isa-debug-exit,iobase=0xf4,iosize=0x04",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
8
sysdata/libraries/stn/src/panic.hb
Normal file
8
sysdata/libraries/stn/src/panic.hb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
panic := fn(message: ?^u8): void {
|
||||||
|
if message != null {
|
||||||
|
log.error(message)
|
||||||
|
}
|
||||||
|
// TODO: replace with die keyword when it gets pushed
|
||||||
|
loop {
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,6 +15,8 @@ Window := struct {
|
||||||
y: int,
|
y: int,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
psf := @embed("../../../consolefonts/tamsyn/10x20r.psf")
|
||||||
|
|
||||||
main := fn(): int {
|
main := fn(): int {
|
||||||
win_buff := buffer.create("XHorizon\0")
|
win_buff := buffer.create("XHorizon\0")
|
||||||
|
|
||||||
|
@ -33,6 +35,8 @@ main := fn(): int {
|
||||||
|
|
||||||
vel_inner := Vec2(int).(1, 1)
|
vel_inner := Vec2(int).(1, 1)
|
||||||
pos_inner := Vec2(uint).((window.width - side) / 2, (window.height - side) / 2)
|
pos_inner := Vec2(uint).((window.width - side) / 2, (window.height - side) / 2)
|
||||||
|
str := "Window Title Bar\0"
|
||||||
|
font := render.text.font_from_psf2(@bitcast(&psf))
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
// Clear the screen
|
// Clear the screen
|
||||||
|
@ -43,6 +47,8 @@ main := fn(): int {
|
||||||
ret := buffer.recv([u8; 4096], win_buff, mem_buf)
|
ret := buffer.recv([u8; 4096], win_buff, mem_buf)
|
||||||
if ret == 0 {
|
if ret == 0 {
|
||||||
log.info("No messages\0")
|
log.info("No messages\0")
|
||||||
|
} else {
|
||||||
|
log.info("Handle Messages\0")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +71,7 @@ main := fn(): int {
|
||||||
{
|
{
|
||||||
render.put_rect(window, .(0, 0), .(window.width - 1, window.height - 1), render.white)
|
render.put_rect(window, .(0, 0), .(window.width - 1, window.height - 1), render.white)
|
||||||
render.put_rect(window, .(0, 0), .(window.width - 1, 20), render.white)
|
render.put_rect(window, .(0, 0), .(window.width - 1, 20), render.white)
|
||||||
|
render.put_text(window, font, .(window.width / 2, 1), render.white, str)
|
||||||
}
|
}
|
||||||
render.put_filled_rect(window, pos_inner, .(side, side), color)
|
render.put_filled_rect(window, pos_inner, .(side, side), color)
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ horizon_api := @use("../../../libraries/horizon_api/src/lib.hb");
|
||||||
ignim := @use("../../../libraries/ignim/src/lib.hb");
|
ignim := @use("../../../libraries/ignim/src/lib.hb");
|
||||||
.{errors} := ignim
|
.{errors} := ignim
|
||||||
|
|
||||||
|
psf := @embed("../../../consolefonts/tamsyn/10x20r.psf")
|
||||||
|
|
||||||
main := fn(): int {
|
main := fn(): int {
|
||||||
x := 0
|
x := 0
|
||||||
// loop if x > 10000 break else x += 1
|
// loop if x > 10000 break else x += 1
|
||||||
|
|
1
sysdata/programs/mouse_driver/README.md
Normal file
1
sysdata/programs/mouse_driver/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# mouse_driver
|
|
@ -9,3 +9,15 @@ hblang.version = "1.0.0"
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
command = "hblang src/main.hb"
|
command = "hblang src/main.hb"
|
||||||
|
|
||||||
|
[package]
|
||||||
|
name = "mouse_driver"
|
||||||
|
authors = [""]
|
||||||
|
|
||||||
|
[dependants.libraries]
|
||||||
|
|
||||||
|
[dependants.binaries]
|
||||||
|
hblang.version = "1.0.0"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
command = "hblang src/main.hb"
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
.{memory, buffer, log, string} := @use("../../../libraries/stn/src/lib.hb")
|
.{memory, buffer, log, string} := @use("../../../libraries/stn/src/lib.hb")
|
||||||
|
render := @use("../../../libraries/render/src/lib.hb")
|
||||||
|
|
||||||
ACK := 250
|
ACK := 250
|
||||||
|
|
||||||
wait_for := fn(for: u8): void {
|
wait_for := fn(for: u8): void {
|
||||||
|
log.info("Start waiting\0")
|
||||||
loop {
|
loop {
|
||||||
if (memory.inb(0x64) & 2 >> for) == for {
|
if (memory.inb(0x64) & 2 >> for) == for {
|
||||||
|
log.info("End waiting\0")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,17 +19,19 @@ send_info := fn(info: u8): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
send_command := fn(command: u8): void {
|
send_command := fn(command: u8): void {
|
||||||
@inline(send_info, 0xD4)
|
send_info(0xD4)
|
||||||
@inline(wait_for, 1)
|
wait_for(1)
|
||||||
memory.outb(0x60, command)
|
memory.outb(0x60, command)
|
||||||
}
|
}
|
||||||
|
|
||||||
get_response := fn(): u8 {
|
get_response := fn(): u8 {
|
||||||
@inline(wait_for, 1)
|
wait_for(1)
|
||||||
return memory.inb(0x60)
|
return memory.inb(0x60)
|
||||||
}
|
}
|
||||||
|
|
||||||
main := fn(): int {
|
main := fn(): int {
|
||||||
|
// screen := render.init(true)
|
||||||
|
|
||||||
format_page := memory.alloc(u8, 1024)
|
format_page := memory.alloc(u8, 1024)
|
||||||
|
|
||||||
wait_for(0)
|
wait_for(0)
|
||||||
|
@ -34,20 +39,40 @@ main := fn(): int {
|
||||||
log.info("Aux mouse device enabled.\0")
|
log.info("Aux mouse device enabled.\0")
|
||||||
|
|
||||||
send_command(0xF6)
|
send_command(0xF6)
|
||||||
_ := get_response()
|
a := get_response()
|
||||||
|
|
||||||
send_command(0xF4)
|
send_command(0xF4)
|
||||||
_ = get_response()
|
b := get_response()
|
||||||
|
|
||||||
|
x := -0
|
||||||
|
y := -0
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
loop if (memory.inb(0x64) & 0x20) == 0x20 break
|
// render.clear(screen, render.black)
|
||||||
|
|
||||||
|
loop {
|
||||||
|
if (memory.inb(0x64) & 0x20) == 0x20 {
|
||||||
|
log.info("Yeah\0")
|
||||||
|
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
status := memory.inb(0x60)
|
status := memory.inb(0x60)
|
||||||
//log.info("NEGATIVE Y MOVEMENT\0\0")
|
|
||||||
log.info(string.display_int(status, format_page, 10))
|
log.info(string.display_int(status, format_page, 10))
|
||||||
d_x := memory.inb(0x60)
|
d_x := memory.inb(0x60)
|
||||||
log.info(string.display_int(d_x, format_page, 10))
|
log.info(string.display_int(d_x, format_page, 10))
|
||||||
|
x = x + d_x
|
||||||
d_y := memory.inb(0x60)
|
d_y := memory.inb(0x60)
|
||||||
|
y = y + d_y
|
||||||
log.info(string.display_int(d_y, format_page, 10))
|
log.info(string.display_int(d_y, format_page, 10))
|
||||||
|
// render.put_rect(screen, .(x, y), .(x + 10, y + 10), render.white)
|
||||||
|
|
||||||
|
log.info("XY\0")
|
||||||
|
|
||||||
|
log.info(string.display_int(x, format_page, 10))
|
||||||
|
log.info(string.display_int(y, format_page, 10))
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
|
@ -10,14 +10,13 @@ example := fn(): void {
|
||||||
screen := render.init(true)
|
screen := render.init(true)
|
||||||
font := render.text.font_from_psf2(@bitcast(&psf))
|
font := render.text.font_from_psf2(@bitcast(&psf))
|
||||||
t := 0
|
t := 0
|
||||||
str := "Hello, World!
|
str := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\0"
|
||||||
This is a test
|
|
||||||
of multiline rendering\0"
|
|
||||||
loop {
|
loop {
|
||||||
render.clear(screen, render.black)
|
render.clear(screen, render.black)
|
||||||
render.put_text(screen, font, .(t, t % screen.height), render.red, str)
|
render.put_text(screen, font, .(t, t % screen.height), render.red, str)
|
||||||
render.sync(screen)
|
render.sync(screen)
|
||||||
t += 1
|
// t += 1
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
|
@ -1,3 +1 @@
|
||||||
.{example} := @use("./examples/cube.hb")
|
.{example: main} := @use("./examples/text.hb")
|
||||||
|
|
||||||
main := example
|
|
|
@ -26,8 +26,8 @@ resolution = "1600x900x24"
|
||||||
# [boot.limine.ableos.modules.diskio_driver]
|
# [boot.limine.ableos.modules.diskio_driver]
|
||||||
# path = "boot:///diskio_driver.hbf"
|
# path = "boot:///diskio_driver.hbf"
|
||||||
|
|
||||||
[boot.limine.ableos.modules.render_example]
|
# [boot.limine.ableos.modules.render_example]
|
||||||
path = "boot:///render_example.hbf"
|
# path = "boot:///render_example.hbf"
|
||||||
|
|
||||||
# [boot.limine.ableos.modules.serial_driver]
|
# [boot.limine.ableos.modules.serial_driver]
|
||||||
# path = "boot:///serial_driver.hbf"
|
# path = "boot:///serial_driver.hbf"
|
||||||
|
|
Loading…
Reference in a new issue