From de8000f5960101d287ad0c838df3a1cf2bb59679 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 13 Oct 2024 23:15:10 +0200 Subject: [PATCH 01/29] Fixed software renderer; added vline,hline,trirect --- sysdata/libraries/render/src/lib.hb | 3 + sysdata/libraries/render/src/software.hb | 58 ++++++++++++- .../src/examples/tactical_screen.hb | 83 +++++++++++++++++++ sysdata/programs/render_example/src/main.hb | 2 +- sysdata/programs/tetris/src/main.hb | 25 ++++-- sysdata/system_config.toml | 4 +- 6 files changed, 165 insertions(+), 10 deletions(-) create mode 100644 sysdata/programs/render_example/src/examples/tactical_screen.hb diff --git a/sysdata/libraries/render/src/lib.hb b/sysdata/libraries/render/src/lib.hb index 5c0baed8..7300319d 100644 --- a/sysdata/libraries/render/src/lib.hb +++ b/sysdata/libraries/render/src/lib.hb @@ -30,7 +30,10 @@ light_cyan := mode.light_cyan put_pixel := mode.put_pixel put_rect := mode.put_rect put_filled_rect := mode.put_filled_rect +put_trirect := mode.put_trirect put_line := mode.put_line +put_vline := mode.put_vline +put_hline := mode.put_hline clear := mode.clear put_img := mode.put_img diff --git a/sysdata/libraries/render/src/software.hb b/sysdata/libraries/render/src/software.hb index a89057b7..87b1bdbd 100644 --- a/sysdata/libraries/render/src/software.hb +++ b/sysdata/libraries/render/src/software.hb @@ -119,7 +119,7 @@ sync := fn(): void { bb := ctx.buf fb := ctx.fb boundary := bb + ctx.pixels - loop if bb == boundary break else { + loop if bb >= boundary break else { *@as(^[Color; copy_pixels], @bitcast(fb)) = *@as(^[Color; copy_pixels], @bitcast(bb)) bb += copy_pixels fb += copy_pixels @@ -137,6 +137,9 @@ height := fn(): int { } screenidx := fn(x: int, y: int): int { + /*if x < 0 || y < 0 || x >= ctx.width || y >= ctx.height { + return -1 + }*/ return x + ctx.width * y } @@ -178,6 +181,27 @@ put_rect := fn(pos: Vec2(int), tr: Vec2(int), color: Color): void { return } +put_trirect := fn(pos: Vec2(int), size: Vec2(int), color0: Color, color1: Color): void { + step := Vec2(int).(1, 1) + if size.x < 0 { + step.x = -1 + } + if size.y < 0 { + step.y = size.y / size.x + } + + start_y := pos.y + target := pos + size + + loop if pos.x == target.x break else { + put_vline(pos.x, pos.y, target.y, color0) + put_vline(pos.x, pos.y, start_y, color1) + pos += step + } + + return +} + put_line_low := fn(p0: Vec2(int), p1: Vec2(int), color: Color): void { dx := p1.x - p0.x dy := p1.y - p0.y @@ -243,6 +267,38 @@ put_line := fn(p0: Vec2(int), p1: Vec2(int), color: Color): void { return } +put_vline := fn(x: int, y0: int, y1: int, color: Color): void { + if y1 < y0 { + tmp := y0 + y0 = y1 + y1 = tmp + } + y := y0 + + loop if y == y1 break else { + *(ctx.buf + @inline(screenidx, x, y)) = color + y += 1 + } + + return +} + +put_hline := fn(y: int, x0: int, x1: int, color: Color): void { + if x1 < x0 { + tmp := x0 + x0 = x1 + x1 = tmp + } + x := x0 + + loop if x == x1 break else { + *(ctx.buf + @inline(screenidx, x, y)) = color + x += 1 + } + + return +} + set_height := fn(new: int): void { return } diff --git a/sysdata/programs/render_example/src/examples/tactical_screen.hb b/sysdata/programs/render_example/src/examples/tactical_screen.hb new file mode 100644 index 00000000..4f227de2 --- /dev/null +++ b/sysdata/programs/render_example/src/examples/tactical_screen.hb @@ -0,0 +1,83 @@ +render := @use("../../../../libraries/render/src/lib.hb"); +.{math, random} := @use("../../../../libraries/stn/src/lib.hb") +Vec2 := math.Vec2 + +/* expected result: + a grid of green lines scrolling from the left top corner to the right bottom one + with a "target" randomly apperaing in one of them and a "seeker" "catching" it*/ + +example := fn(): void { + render.init() + + width := render.width() + height := render.height() + cell_size := 0 + range := Vec2(int).(0, 0) + if width > height { + cell_size = width / 40 + range = .(39, height / cell_size - 1) + } else { + cell_size = height / 40 + range = .(width / cell_size - 1, 39) + } + width -= 1 + height -= 1 + + scroll := 0 + target := Vec2(int).(random.range(int, 0, range.x), random.range(int, 0, range.y)) + + halfcell := cell_size / 2 + octcell := cell_size / 8 + sevenoctcell := cell_size - octcell + + seeker := Vec2(int).(random.range(int, 0, range.x), random.range(int, 0, range.y)) + + loop { + render.clear(render.black) + + target_pixel_coord := target * .(cell_size, cell_size) + .(scroll, scroll) + render.put_trirect(target_pixel_coord, .(cell_size, cell_size), render.red, render.light_red) + + render.put_hline(target_pixel_coord.y + halfcell, target_pixel_coord.x - octcell, target_pixel_coord.x - sevenoctcell, render.light_red) + render.put_hline(target_pixel_coord.y + halfcell, target_pixel_coord.x + cell_size + octcell, target_pixel_coord.x + cell_size + sevenoctcell, render.light_red) + render.put_vline(target_pixel_coord.x + halfcell, target_pixel_coord.y - octcell, target_pixel_coord.y - sevenoctcell, render.light_red) + render.put_vline(target_pixel_coord.x + halfcell, target_pixel_coord.y + cell_size + octcell, target_pixel_coord.y + cell_size + sevenoctcell, render.light_red) + + x := scroll + loop if x > width break else { + render.put_vline(x, 0, height, .(0, 127, 0, 127)) + x += cell_size + } + + y := scroll + loop if y > height break else { + render.put_hline(y, 0, width, .(0, 127, 0, 127)) + y += cell_size + } + + render.put_hline(seeker.y * cell_size + halfcell + scroll, 0, width, render.light_green) + render.put_vline(seeker.x * cell_size + halfcell + scroll, 0, height, render.light_green) + + render.sync() + + if seeker.x < target.x { + seeker.x += 1 + } else if seeker.x > target.x { + seeker.x -= 1 + } else if seeker.y < target.y { + seeker.y += 1 + } else if seeker.y > target.y { + seeker.y -= 1 + } else { + target = .(random.range(int, 0, range.x), random.range(int, 0, range.y)) + } + + scroll += 1 + if scroll > cell_size { + scroll = 0 + target += .(1, 1) + seeker += .(1, 1) + } + } + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/main.hb b/sysdata/programs/render_example/src/main.hb index 35b2706e..5d15c24c 100644 --- a/sysdata/programs/render_example/src/main.hb +++ b/sysdata/programs/render_example/src/main.hb @@ -1,4 +1,4 @@ -.{example} := @use("./examples/amogus.hb") +.{example} := @use("./examples/tactical_screen.hb") main := fn(): void { @inline(example) diff --git a/sysdata/programs/tetris/src/main.hb b/sysdata/programs/tetris/src/main.hb index e61324b3..65aebf3b 100644 --- a/sysdata/programs/tetris/src/main.hb +++ b/sysdata/programs/tetris/src/main.hb @@ -1,14 +1,27 @@ -.{memory, log, string, buffer} := @use("../../../libraries/stn/src/lib.hb") +.{memory, log, string, buffer, math} := @use("../../../libraries/stn/src/lib.hb") +render := @use("../../../libraries/render/src/lib.hb") +Color := render.Color +Vec2 := math.Vec2 main := fn(): void { - storage := @as(u8, 0) + input := @as(u8, 0) output_buffer := memory.request_page(1) input_buffer := buffer.search("XKeyboard\0") + + render.init() + loop { - buffer.recv(input_buffer, &storage, 1) - if storage != 0 { - log.info(string.display_int(storage, output_buffer)) - storage = 0 + render.clear(render.black) + render.put_vline(100, 255, 128, Color.(255, 255, 255, 255)) + render.put_hline(64, 100 - 64, 164, Color.(255, 255, 255, 255)) + render.put_trirect(Vec2(int).(128, 128 + 256), Vec2(int).(256, -256), Color.(147, 147, 147, 255), Color.(107, 107, 107, 255)) + render.put_filled_rect(Vec2(int).(128 + 32, 128 + 32), Vec2(int).(256 - 64, 256 - 64), Color.(127, 127, 127, 127)) + render.sync() + + buffer.recv(input_buffer, &input, 1) + if input != 0 { + log.info(string.display_int(input, output_buffer)) + input = 0 } } return diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index e4bd86f7..48aa1053 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -3,7 +3,7 @@ default_entry = 1 timeout = 0 verbose = false -interface_resolution = "1024x768x24" +interface_resolution = "1600x900x24" # interface_resolution = "640x480x32" # Terminal related settings term_wallpaper = "boot:///background.bmp" @@ -16,7 +16,7 @@ protocol = "limine" kernel_path = "boot:///kernel_${ARCH}" kernel_cmdline = "" # resolution = "640x480x32" -resolution = "1024x768x24" +resolution = "1600x900x24" [boot.limine.ableos.modules] From 39ebaa03ba233f63c7aea2d2858b018e8c42abd1 Mon Sep 17 00:00:00 2001 From: peony Date: Mon, 14 Oct 2024 14:35:41 +0200 Subject: [PATCH 02/29] Uuuugh --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bfd0b3e1..c7b27228 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -350,12 +350,12 @@ checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#6d7e726066109e8b08f049bbc4684bba2a2eb88a" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#dc2e0cc5b36f84f9d5bb82b6f48e6b29869746d5" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#6d7e726066109e8b08f049bbc4684bba2a2eb88a" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#dc2e0cc5b36f84f9d5bb82b6f48e6b29869746d5" dependencies = [ "hashbrown 0.15.0", "hbbytecode", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#6d7e726066109e8b08f049bbc4684bba2a2eb88a" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#dc2e0cc5b36f84f9d5bb82b6f48e6b29869746d5" dependencies = [ "hbbytecode", ] From 3708acc077b730c41cf9b7cf55ae6ed79a660dff Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 10 Nov 2024 15:09:41 +0100 Subject: [PATCH 03/29] Revert to mainline --- sysdata/libraries/render/src/lib.hb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysdata/libraries/render/src/lib.hb b/sysdata/libraries/render/src/lib.hb index dd8a3f1a..4e656a2a 100644 --- a/sysdata/libraries/render/src/lib.hb +++ b/sysdata/libraries/render/src/lib.hb @@ -46,9 +46,9 @@ clear := mode.clear put_surface := mode.put_surface put_text := mode.put_text // thanks peony for these three! -put_trirect := mode.put_trirect -put_vline := mode.put_vline -put_hline := mode.put_hline +//put_trirect := mode.put_trirect +//put_vline := mode.put_vline +//put_hline := mode.put_hline // Display sync := mode.sync \ No newline at end of file From 4c0adbe15d51052eed4e6b1a4b44df228db3f233 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 10 Nov 2024 15:19:55 +0100 Subject: [PATCH 04/29] Circle rendring. --- sysdata/libraries/render/src/lib.hb | 3 + sysdata/libraries/render/src/software.hb | 84 ++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/sysdata/libraries/render/src/lib.hb b/sysdata/libraries/render/src/lib.hb index 4e656a2a..00279a3f 100644 --- a/sysdata/libraries/render/src/lib.hb +++ b/sysdata/libraries/render/src/lib.hb @@ -39,6 +39,9 @@ put_pixel := mode.put_pixel put_rect := mode.put_rect put_filled_rect := mode.put_filled_rect put_trirect := mode.put_trirect +put_circle := mode.put_circle +put_filled_circle := mode.put_filled_circle +put_textured_circle := mode.put_textured_circle put_line := mode.put_line put_vline := mode.put_vline put_hline := mode.put_hline diff --git a/sysdata/libraries/render/src/software.hb b/sysdata/libraries/render/src/software.hb index efc8d92e..0c4780e6 100644 --- a/sysdata/libraries/render/src/software.hb +++ b/sysdata/libraries/render/src/software.hb @@ -251,6 +251,90 @@ put_hline := fn(surface: Surface, y: uint, x0: uint, x1: uint, color: Color): vo return } + +put_circle := fn(surface: Surface, pos: Vec2(uint), radius: uint, color: Color): void { + x := 0 + y := radius + error := @as(int, 3) - @as(int, @intcast(2 * radius)); + *@inline(indexptr, surface, pos.x + radius, pos.y) = color; + *@inline(indexptr, surface, pos.x - radius, pos.y) = color; + *@inline(indexptr, surface, pos.x, pos.y + radius) = color; + *@inline(indexptr, surface, pos.x, pos.y - radius) = color + + loop if y < x break else { + x += 1 + + if error > 0 { + y -= 1 + error += 4 * (@as(int, @intcast(x)) - @as(int, @intcast(y))) + 10 + } else { + error += 4 * @intcast(x) + 6 + }; + *@inline(indexptr, surface, pos.x + x, pos.y + y) = color; + *@inline(indexptr, surface, pos.x + y, pos.y + x) = color; + *@inline(indexptr, surface, pos.x - x, pos.y + y) = color; + *@inline(indexptr, surface, pos.x - y, pos.y + x) = color; + *@inline(indexptr, surface, pos.x + x, pos.y - y) = color; + *@inline(indexptr, surface, pos.x + y, pos.y - x) = color; + *@inline(indexptr, surface, pos.x - x, pos.y - y) = color; + *@inline(indexptr, surface, pos.x - y, pos.y - x) = color + } + + return +} + +put_filled_circle := fn(surface: Surface, pos: Vec2(uint), radius: uint, color: Color): void { + x := 0 + y := radius + error := @as(int, 3) - @as(int, @intcast(2 * radius)) + @inline(put_hline, surface, pos.y - x, pos.x - radius, pos.x + radius, color); + *@inline(indexptr, surface, pos.x, pos.y + radius) = color; + *@inline(indexptr, surface, pos.x, pos.y - radius) = color + + loop if y < x break else { + x += 1 + + if error > 0 { + @inline(put_hline, surface, pos.y + y, pos.x - x, pos.x + x, color) + @inline(put_hline, surface, pos.y - y, pos.x - x, pos.x + x, color) + y -= 1 + error += 4 * (@as(int, @intcast(x)) - @as(int, @intcast(y))) + 10 + } else { + error += 4 * @intcast(x) + 6 + } + @inline(put_hline, surface, pos.y + x, pos.x - y, pos.x + y, color) + @inline(put_hline, surface, pos.y - x, pos.x - y, pos.x + y, color) + } + + return +} + +put_textured_circle := fn(surface: Surface, source: Surface, source_pos: Vec2(uint), pos: Vec2(uint), radius: uint): void { + x := 0 + y := radius + error := @as(int, 3) - @as(int, @intcast(2 * radius)) + @inline(memory.copy, Color, @inline(indexptr, source, source_pos.x - y, source_pos.y), @inline(indexptr, surface, pos.x - y, pos.y), 2 * y); + *@inline(indexptr, surface, pos.x, pos.y + y) = *@inline(indexptr, source, source_pos.x, source_pos.y + y); + *@inline(indexptr, surface, pos.x, pos.y - y) = *@inline(indexptr, source, source_pos.x, source_pos.y - y) + + loop if y < x break else { + x += 1 + + if error > 0 { + @inline(memory.copy, Color, @inline(indexptr, source, source_pos.x - x, source_pos.y + y), @inline(indexptr, surface, pos.x - x, pos.y + y), 2 * x) + @inline(memory.copy, Color, @inline(indexptr, source, source_pos.x - x, source_pos.y - y), @inline(indexptr, surface, pos.x - x, pos.y - y), 2 * x) + y -= 1 + error += 4 * (@as(int, @intcast(x)) - @as(int, @intcast(y))) + 10 + } else { + error += 4 * @intcast(x) + 6 + } + @inline(memory.copy, Color, @inline(indexptr, source, source_pos.x - y, source_pos.y + x), @inline(indexptr, surface, pos.x - y, pos.y + x), 2 * y) + @inline(memory.copy, Color, @inline(indexptr, source, source_pos.x - y, source_pos.y - x), @inline(indexptr, surface, pos.x - y, pos.y - x), 2 * y) + } + + return +} + utf8_len_table := [u8].(0, 0, 2, 3) put_text := fn(surface: Surface, font: Font, pos: Vec2(uint), color: Color, str: ^u8): void { From 8f5833955f535dc81df956380795c67428ebf00c Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 10 Nov 2024 15:42:41 +0100 Subject: [PATCH 05/29] Circle test. (Precision issues) --- .../render_example/src/examples/orbit.hb | 36 +++++++++++++++++++ sysdata/programs/render_example/src/main.hb | 2 +- sysdata/programs/tetris/src/main.hb | 28 --------------- sysdata/system_config.toml | 12 +++---- 4 files changed, 43 insertions(+), 35 deletions(-) create mode 100644 sysdata/programs/render_example/src/examples/orbit.hb delete mode 100644 sysdata/programs/tetris/src/main.hb diff --git a/sysdata/programs/render_example/src/examples/orbit.hb b/sysdata/programs/render_example/src/examples/orbit.hb new file mode 100644 index 00000000..84b47e3c --- /dev/null +++ b/sysdata/programs/render_example/src/examples/orbit.hb @@ -0,0 +1,36 @@ +.{Vec2, sin, cos, PI} := @use("../../../../libraries/stn/src/lib.hb").math +render := @use("../../../../libraries/render/src/lib.hb") + +able_bmp := @embed("../../../../assets/able.bmp") +mini_bmp := @embed("../../../../assets/mini.bmp") + +/* expected result: + two textured circles rotating + around one yellow filled circle + with a blue line showing their + 'orbit' */ + +example := fn(): void { + able := render.image.from(@bitcast(&able_bmp)) + mini := render.image.from(@bitcast(&mini_bmp)) + if able == null | mini == null { + return + } + + angle := 0.0 + + screen := render.init(true) + + loop { + 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) + + angle += 0.01 + } + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/main.hb b/sysdata/programs/render_example/src/main.hb index 77cb04c0..ab66cfa8 100644 --- a/sysdata/programs/render_example/src/main.hb +++ b/sysdata/programs/render_example/src/main.hb @@ -1 +1 @@ -.{example: main} := @use("./examples/text.hb") \ No newline at end of file +.{example: main} := @use("./examples/orbit.hb") \ No newline at end of file diff --git a/sysdata/programs/tetris/src/main.hb b/sysdata/programs/tetris/src/main.hb deleted file mode 100644 index f4eaa3bb..00000000 --- a/sysdata/programs/tetris/src/main.hb +++ /dev/null @@ -1,28 +0,0 @@ -.{memory, log, string, buffer, math} := @use("../../../libraries/stn/src/lib.hb") -render := @use("../../../libraries/render/src/lib.hb") -Color := render.Color -Vec2 := math.Vec2 - -main := fn(): void { - input := @as(u8, 0) - output_buffer := memory.request_page(1) - input_buffer := buffer.search("XKeyboard\0") - - render.init() - - loop { - render.clear(render.black) - render.put_vline(100, 255, 128, Color.(255, 255, 255, 255)) - render.put_hline(64, 100 - 64, 164, Color.(255, 255, 255, 255)) - render.put_trirect(Vec2(int).(128, 128 + 256), Vec2(int).(256, -256), Color.(147, 147, 147, 255), Color.(107, 107, 107, 255)) - render.put_filled_rect(Vec2(int).(128 + 32, 128 + 32), Vec2(int).(256 - 64, 256 - 64), Color.(127, 127, 127, 127)) - render.sync() - - buffer.recv(input_buffer, &input, 1) - if input != 0 { - log.info(string.display_int(input, output_buffer)) - input = 0 - } - } - return -} diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 1992a800..93bd7396 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -22,14 +22,14 @@ resolution = "1024x768x24" [boot.limine.ableos.modules] -# [boot.limine.ableos.modules.render_example] -# path = "boot:///render_example.hbf" +[boot.limine.ableos.modules.render_example] +path = "boot:///render_example.hbf" -[boot.limine.ableos.modules.horizon] -path = "boot:///horizon.hbf" +# [boot.limine.ableos.modules.horizon] +# path = "boot:///horizon.hbf" -[boot.limine.ableos.modules.ps2_mouse_driver] -path = "boot:///ps2_mouse_driver.hbf" +# [boot.limine.ableos.modules.ps2_mouse_driver] +# path = "boot:///ps2_mouse_driver.hbf" # [boot.limine.ableos.modules.ps2_keyboard_driver] # path = "boot:///ps2_keyboard_driver.hbf" From 89d08d8a624325721fc55e9603c4ca0c6a0294ce Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 10 Nov 2024 15:44:17 +0100 Subject: [PATCH 06/29] Alighning with master. --- sysdata/libraries/render/src/lib.hb | 3 --- 1 file changed, 3 deletions(-) diff --git a/sysdata/libraries/render/src/lib.hb b/sysdata/libraries/render/src/lib.hb index 00279a3f..ff772083 100644 --- a/sysdata/libraries/render/src/lib.hb +++ b/sysdata/libraries/render/src/lib.hb @@ -49,9 +49,6 @@ clear := mode.clear put_surface := mode.put_surface put_text := mode.put_text // thanks peony for these three! -//put_trirect := mode.put_trirect -//put_vline := mode.put_vline -//put_hline := mode.put_hline // Display sync := mode.sync \ No newline at end of file From aac1164d55a94994ffa125c45343dbd2b8e02868 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 10 Nov 2024 15:45:01 +0100 Subject: [PATCH 07/29] More git stuff --- sysdata/libraries/render/src/lib.hb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sysdata/libraries/render/src/lib.hb b/sysdata/libraries/render/src/lib.hb index ff772083..00279a3f 100644 --- a/sysdata/libraries/render/src/lib.hb +++ b/sysdata/libraries/render/src/lib.hb @@ -49,6 +49,9 @@ clear := mode.clear put_surface := mode.put_surface put_text := mode.put_text // thanks peony for these three! +//put_trirect := mode.put_trirect +//put_vline := mode.put_vline +//put_hline := mode.put_hline // Display sync := mode.sync \ No newline at end of file From be6a095c149ac1488a9001884099cb92af2dcc42 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 10 Nov 2024 19:14:20 +0100 Subject: [PATCH 08/29] Cargo stuff --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56dc2fc0..dfc9b2e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -228,12 +228,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#8b98c2ed1becb92046bb7b687ca00813da441248" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654005eea293b1a2e7d81a08d5d4cb542d4cc8a2" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#8b98c2ed1becb92046bb7b687ca00813da441248" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654005eea293b1a2e7d81a08d5d4cb542d4cc8a2" 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#8b98c2ed1becb92046bb7b687ca00813da441248" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654005eea293b1a2e7d81a08d5d4cb542d4cc8a2" dependencies = [ "hbbytecode", ] From cc4a32afaa5541f392b6874bc4465170fb5231d9 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 10 Nov 2024 21:24:19 +0100 Subject: [PATCH 09/29] PS/2 work --- Cargo.lock | 6 +- sysdata/programs/ps2_driver/README.md | 12 +++ sysdata/programs/ps2_driver/meta.toml | 11 +++ sysdata/programs/ps2_driver/src/main.hb | 108 ++++++++++++++++++++++++ sysdata/system_config.toml | 7 +- 5 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 sysdata/programs/ps2_driver/README.md create mode 100644 sysdata/programs/ps2_driver/meta.toml create mode 100644 sysdata/programs/ps2_driver/src/main.hb diff --git a/Cargo.lock b/Cargo.lock index dfc9b2e3..1e015747 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -228,12 +228,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654005eea293b1a2e7d81a08d5d4cb542d4cc8a2" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#c61efc393361089f5217db9f4a9011ed0248b8db" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654005eea293b1a2e7d81a08d5d4cb542d4cc8a2" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#c61efc393361089f5217db9f4a9011ed0248b8db" 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#654005eea293b1a2e7d81a08d5d4cb542d4cc8a2" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#c61efc393361089f5217db9f4a9011ed0248b8db" dependencies = [ "hbbytecode", ] diff --git a/sysdata/programs/ps2_driver/README.md b/sysdata/programs/ps2_driver/README.md new file mode 100644 index 00000000..c0a3d838 --- /dev/null +++ b/sysdata/programs/ps2_driver/README.md @@ -0,0 +1,12 @@ +# Unified PS/2 Driver + +Te entire thing is heavily documented with comments because I'm not sure how else to make this understandable. + +## !!Assumptions!! +Anyone who works on this should work to keep this list as small as possible/remove as many of these as possible. +- Bit 5 of the response form 0x64 indicates which port the data is coming from. (Not true on all systems) +- A parity or timeout error never occurs. +- PS/2 controller exists. +- Both PS/2 ports being broken doesn't need handling. +- One PS/2 port being broken doesn't need special attention. +- PS/2 controller doesn't need to perform a self-check. diff --git a/sysdata/programs/ps2_driver/meta.toml b/sysdata/programs/ps2_driver/meta.toml new file mode 100644 index 00000000..005cb926 --- /dev/null +++ b/sysdata/programs/ps2_driver/meta.toml @@ -0,0 +1,11 @@ +[package] +name = "ps2_driver" +authors = ["Peony"] + +[dependants.libraries] + +[dependants.binaries] +hblang.version = "1.0.0" + +[build] +command = "hblang src/main.hb" diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb new file mode 100644 index 00000000..351187bb --- /dev/null +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -0,0 +1,108 @@ +.{memory, log} := @use("../../../libraries/stn/src/lib.hb") + +DeviceID := struct {value: u16} + +$Mouse3Button := DeviceID.(0x0) +$MouseScrollwheel := DeviceID.(0x3) +$Mouse5Button := DeviceID.(0x4) +$Spacesaver := DeviceID.(0xAB84) +$Keyboard122Key := DeviceID.(0xAB86) +$KeyboardJapaneseG := DeviceID.(0xAB90) +$KeyboardJapanesep := DeviceID.(0xAB91) +$KeyboardJapaneseA := DeviceID.(0xAB92) +$KeyboardNCDSun := DeviceID.(0xACA1) +$NoDevice := DeviceID.(0xFFFF) + +Port := struct {exists: bool, device: DeviceID, command_queued: bool, command_queue: u8} + +$check_bit := fn(value: u8, bit: u8, state: u8): bool { + return value >> bit & 1 == state +} + +ports := [Port].(.(true, NoDevice, false, 0xFF), .(true, NoDevice, false, 0xFF)) + +$initialize_controller := fn(): void { + memory.outb(0x64, 0xAD) + memory.outb(0x64, 0xA7) + //Disables ports to make sure that they won't interfere with the setup process. + + loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) + //Flushes any output because apperantly that might interfere with stuff. + + memory.outb(0x64, 0xA8) + //Enables port 2. + memory.outb(0x64, 0x20) + //Gimme configuration byte. + loop if (memory.inb(0x64) & 1) == 1 break + ports[1].exists = check_bit(memory.inb(0x60), 5, 0) + if ports[1].exists { + memory.outb(0x64, 0xA7) + } + + loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) + //Flushes any output because apperantly that might interfere with stuff. + + memory.outb(0x64, 0xAB) + loop if (memory.inb(0x64) & 1) == 1 break + ports[0].exists = memory.inb(0x60) == 0x0 + //Test port 1. + + if ports[1].exists { + memory.outb(0x64, 0xA9) + loop if (memory.inb(0x64) & 1) == 1 break + ports[1].exists = memory.inb(0x60) == 0x0 + } + //Test port 2. + + if (ports[0].exists | ports[1].exists) == false { + log.error("No ports detected! No input will be processed! Cannot handle this!\0") + } + + if ports[0].exists { + memory.outb(0x64, 0xAE) + //Enables port 1. + ports[0].command_queued = true + } + if ports[1].exists { + memory.outb(0x64, 0xA8) + //Enables port 2. + ports[1].command_queued = true + } +} + +handle_input := fn(port: uint, input: u8): void { +} + +main := fn(): void { + loop { + port_info := memory.inb(0x64) + //Enables port 1. + if (port_info & 0x40) > 0 { + log.error("Timeout error! Cannot handle these!\0") + } + if (port_info & 0x80) > 0 { + log.error("Parity error! Cannot handle these!\0") + } + + if (port_info & 1) == 0 { + if ports[0].exists & ports[0].command_queued { + memory.outb(0x60, ports[0].command_queue) + ports[0].command_queued = false + } + if ports[1].exists & ports[1].command_queued { + memory.outb(0x64, 0xD4) + memory.outb(0x60, ports[1].command_queue) + ports[1].command_queued = false + } + } + + port := 0 + if ports[1].exists { + port = port_info >> 5 & 1 + } + + if ports[port].exists { + @inline(handle_input, port, memory.inb(0x60)) + } + } +} \ No newline at end of file diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 93bd7396..688c7627 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -22,8 +22,8 @@ resolution = "1024x768x24" [boot.limine.ableos.modules] -[boot.limine.ableos.modules.render_example] -path = "boot:///render_example.hbf" +# [boot.limine.ableos.modules.render_example] +# path = "boot:///render_example.hbf" # [boot.limine.ableos.modules.horizon] # path = "boot:///horizon.hbf" @@ -33,3 +33,6 @@ path = "boot:///render_example.hbf" # [boot.limine.ableos.modules.ps2_keyboard_driver] # path = "boot:///ps2_keyboard_driver.hbf" + +[boot.limine.ableos.modules.ps2_driver] +path = "boot:///ps2_driver.hbf" From a1bfd8e85fff4f16fd77d15739fd792bbf2e856c Mon Sep 17 00:00:00 2001 From: peony Date: Tue, 12 Nov 2024 22:36:43 +0100 Subject: [PATCH 10/29] Driver not work --- Cargo.lock | 22 +++++++-------- sysdata/programs/ps2_driver/src/main.hb | 37 ++++++++++++++++++------- sysdata/system_config.toml | 11 +++++--- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46647884..54ba9a56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611cc2ae7d2e242c457e4be7f97036b8ad9ca152b499f53faf99b1ed8fc2553f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "anyhow" @@ -82,9 +82,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.37" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" dependencies = [ "shlex", ] @@ -228,12 +228,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#b6274f3455d0545a64f2cc866b39d409e0a73427" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#0d87bf8f0977fd929af28f6cd8007b603bc974bc" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#b6274f3455d0545a64f2cc866b39d409e0a73427" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#0d87bf8f0977fd929af28f6cd8007b603bc974bc" 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#b6274f3455d0545a64f2cc866b39d409e0a73427" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#0d87bf8f0977fd929af28f6cd8007b603bc974bc" dependencies = [ "hbbytecode", ] @@ -675,18 +675,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index 351187bb..dc4bbe05 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -5,23 +5,27 @@ DeviceID := struct {value: u16} $Mouse3Button := DeviceID.(0x0) $MouseScrollwheel := DeviceID.(0x3) $Mouse5Button := DeviceID.(0x4) -$Spacesaver := DeviceID.(0xAB84) -$Keyboard122Key := DeviceID.(0xAB86) -$KeyboardJapaneseG := DeviceID.(0xAB90) -$KeyboardJapanesep := DeviceID.(0xAB91) -$KeyboardJapaneseA := DeviceID.(0xAB92) -$KeyboardNCDSun := DeviceID.(0xACA1) +$Spacesaver := DeviceID.(0x84AB) +$Keyboard122Key := DeviceID.(0x86AB) +$KeyboardJapaneseG := DeviceID.(0x90AB) +$KeyboardJapanesep := DeviceID.(0x91AB) +$KeyboardJapaneseA := DeviceID.(0x92AB) +$KeyboardNCDSun := DeviceID.(0xA1AC) $NoDevice := DeviceID.(0xFFFF) -Port := struct {exists: bool, device: DeviceID, command_queued: bool, command_queue: u8} +State := struct {value: u8} +$Recive := State.(0) +$Reboot := State.(1) + +Port := struct {exists: bool, device: DeviceID, command_queued: bool, command_queue: u8, state: State, expecting: bool, expecting_data: u8} $check_bit := fn(value: u8, bit: u8, state: u8): bool { - return value >> bit & 1 == state + return (value >> bit & 1) == state } -ports := [Port].(.(true, NoDevice, false, 0xFF), .(true, NoDevice, false, 0xFF)) +ports := [Port].(.(true, NoDevice, false, 0xFF, Reboot, false, 0x0), .(true, NoDevice, false, 0xFF, Reboot, false, 0x0)) -$initialize_controller := fn(): void { +initialize_controller := fn(): void { memory.outb(0x64, 0xAD) memory.outb(0x64, 0xA7) //Disables ports to make sure that they won't interfere with the setup process. @@ -71,9 +75,22 @@ $initialize_controller := fn(): void { } handle_input := fn(port: uint, input: u8): void { + if ports[port].state.value == Recive.value { + } else if ports[port].state.value == Reboot.value { + if input == 0xAA { + log.info("Device rebooted!\0") + ports[port].state = Recive + } else if (ports[port].device.value & 15) == 0 { + ports[port].device.value |= input + } else { + ports[port].device.value |= input << 4 + } + } } main := fn(): void { + @inline(initialize_controller) + loop { port_info := memory.inb(0x64) //Enables port 1. diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index da9cbd07..89830c95 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -34,8 +34,11 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.ps2_keyboard_driver] # path = "boot:///ps2_keyboard_driver.hbf" -[boot.limine.ableos.modules.sunset_client] -path = "boot:///sunset_client.hbf" +[boot.limine.ableos.modules.ps2_driver] +path = "boot:///ps2_driver.hbf" -[boot.limine.ableos.modules.sunset_server] -path = "boot:///sunset_server.hbf" +# [boot.limine.ableos.modules.sunset_client] +# path = "boot:///sunset_client.hbf" + +# [boot.limine.ableos.modules.sunset_server] +# path = "boot:///sunset_server.hbf" From 08099b0877da5fbcfb13138caac07634f32d3488 Mon Sep 17 00:00:00 2001 From: peony Date: Fri, 15 Nov 2024 20:47:11 +0100 Subject: [PATCH 11/29] Barely any PS/2 driver work --- Cargo.lock | 10 +++++----- sysdata/programs/ps2_driver/src/main.hb | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 54ba9a56..2a1a4269 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -228,12 +228,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#0d87bf8f0977fd929af28f6cd8007b603bc974bc" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#f524013c34ff5868eadc0afdf1168239f31c7ee0" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#0d87bf8f0977fd929af28f6cd8007b603bc974bc" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#f524013c34ff5868eadc0afdf1168239f31c7ee0" 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#0d87bf8f0977fd929af28f6cd8007b603bc974bc" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#f524013c34ff5868eadc0afdf1168239f31c7ee0" dependencies = [ "hbbytecode", ] @@ -824,9 +824,9 @@ dependencies = [ [[package]] name = "uart_16550" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4922792855b1bce30997fbaa5418597902c278a92d20dfe348e6f062c3bd861d" +checksum = "e492212ac378a5e00da953718dafb1340d9fbaf4f27d6f3c5cab03d931d1c049" dependencies = [ "bitflags 2.6.0", "rustversion", diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index dc4bbe05..a6dccf63 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -1,4 +1,5 @@ -.{memory, log} := @use("../../../libraries/stn/src/lib.hb") +.{memory, log, string} := @use("../../../libraries/stn/src/lib.hb") +format_page := memory.dangling(u8) DeviceID := struct {value: u16} @@ -63,11 +64,13 @@ initialize_controller := fn(): void { } if ports[0].exists { + log.info("Port 1 exists.\0") memory.outb(0x64, 0xAE) //Enables port 1. ports[0].command_queued = true } if ports[1].exists { + log.info("Port 2 exists.\0") memory.outb(0x64, 0xA8) //Enables port 2. ports[1].command_queued = true @@ -75,20 +78,17 @@ initialize_controller := fn(): void { } handle_input := fn(port: uint, input: u8): void { - if ports[port].state.value == Recive.value { - } else if ports[port].state.value == Reboot.value { - if input == 0xAA { - log.info("Device rebooted!\0") - ports[port].state = Recive - } else if (ports[port].device.value & 15) == 0 { - ports[port].device.value |= input - } else { - ports[port].device.value |= input << 4 - } + if input == 0xAA { + log.info("Device rebooted!\0") + log.info(string.display_int(@intcast(port + 1), format_page, 16)) + ports[port].state = Recive + } else if ports[port].state.value == Recive.value { } } main := fn(): void { + format_page = memory.alloc(u8, 1024) + @inline(initialize_controller) loop { From efcd6c0631df6666a69e932d098545000b082d4d Mon Sep 17 00:00:00 2001 From: peony Date: Fri, 15 Nov 2024 22:55:44 +0100 Subject: [PATCH 12/29] Uuugh, jesus this sucks --- sysdata/programs/ps2_driver/src/main.hb | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index a6dccf63..21946cf2 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -17,14 +17,16 @@ $NoDevice := DeviceID.(0xFFFF) State := struct {value: u8} $Recive := State.(0) $Reboot := State.(1) +$GetID := State.(2) +$TurnOnStreaming := State.(3) -Port := struct {exists: bool, device: DeviceID, command_queued: bool, command_queue: u8, state: State, expecting: bool, expecting_data: u8} +Port := struct {exists: bool, device: DeviceID, commands_queued: u8, command_queue: [u8; 8], awaiting_ack: bool, state: State, expecting: bool, expecting_data: u8} $check_bit := fn(value: u8, bit: u8, state: u8): bool { return (value >> bit & 1) == state } -ports := [Port].(.(true, NoDevice, false, 0xFF, Reboot, false, 0x0), .(true, NoDevice, false, 0xFF, Reboot, false, 0x0)) +ports := [Port].(.(true, NoDevice, 1, .(0xFF, 0, 0, 0, 0, 0, 0, 0), false, Reboot, false, 0x0), .(true, NoDevice, 1, .(0xFF, 0, 0, 0, 0, 0, 0, 0), false, Reboot, false, 0x0)) initialize_controller := fn(): void { memory.outb(0x64, 0xAD) @@ -67,13 +69,13 @@ initialize_controller := fn(): void { log.info("Port 1 exists.\0") memory.outb(0x64, 0xAE) //Enables port 1. - ports[0].command_queued = true + ports[0].commands_queued = 1 } if ports[1].exists { log.info("Port 2 exists.\0") memory.outb(0x64, 0xA8) //Enables port 2. - ports[1].command_queued = true + ports[1].commands_queued = 1 } } @@ -102,14 +104,14 @@ main := fn(): void { } if (port_info & 1) == 0 { - if ports[0].exists & ports[0].command_queued { + if ports[0].exists & ports[0].commands_queued > 0 { memory.outb(0x60, ports[0].command_queue) - ports[0].command_queued = false + ports[0].commands_queued -= 1 } - if ports[1].exists & ports[1].command_queued { + if ports[1].exists & ports[1].commands_queued > 0 { memory.outb(0x64, 0xD4) memory.outb(0x60, ports[1].command_queue) - ports[1].command_queued = false + ports[1].commands_queued -= 1 } } @@ -119,7 +121,12 @@ main := fn(): void { } if ports[port].exists { - @inline(handle_input, port, memory.inb(0x60)) + input := memory.inb(0x60) + if ports[port].awaiting_ack & input == 0xFA { + ports[port].awaiting_ack = false + } else { + @inline(handle_input, port, input) + } } } } \ No newline at end of file From f5c6d7d822a49588b59fbced23a5ca9f8e9b81ea Mon Sep 17 00:00:00 2001 From: peony Date: Sat, 16 Nov 2024 21:51:55 +0100 Subject: [PATCH 13/29] PS/2 driver refactoring and poassibly completion process --- Cargo.lock | 55 ++----- sysdata/programs/ps2_driver/src/bits.hb | 26 ++++ sysdata/programs/ps2_driver/src/controller.hb | 53 +++++++ sysdata/programs/ps2_driver/src/main.hb | 126 --------------- .../programs/ps2_driver/src/main_legacy.hb | 144 ++++++++++++++++++ sysdata/programs/ps2_driver/src/port.hb | 10 ++ 6 files changed, 243 insertions(+), 171 deletions(-) create mode 100644 sysdata/programs/ps2_driver/src/bits.hb create mode 100644 sysdata/programs/ps2_driver/src/controller.hb create mode 100644 sysdata/programs/ps2_driver/src/main_legacy.hb create mode 100644 sysdata/programs/ps2_driver/src/port.hb diff --git a/Cargo.lock b/Cargo.lock index 17a86d65..a0152a0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,15 +65,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" -dependencies = [ - "allocator-api2", -] - [[package]] name = "byteorder" version = "1.5.0" @@ -208,12 +199,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hashbrown" version = "0.15.1" @@ -228,24 +213,23 @@ 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#a64383e72b0920ef1c03773aac197404c78b330f" [[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#a64383e72b0920ef1c03773aac197404c78b330f" dependencies = [ - "hashbrown 0.15.1", + "hashbrown", "hbbytecode", "hbvm", "log", - "regalloc2", ] [[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#a64383e72b0920ef1c03773aac197404c78b330f" dependencies = [ "hbbytecode", ] @@ -396,7 +380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown", ] [[package]] @@ -406,7 +390,7 @@ dependencies = [ "aarch64-cpu", "crossbeam-queue", "derive_more", - "hashbrown 0.15.1", + "hashbrown", "hbvm", "limine", "log", @@ -428,9 +412,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "limine" @@ -553,19 +537,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "regalloc2" -version = "0.10.2" -source = "git+https://github.com/jakubDoka/regalloc2?branch=reuse-allocations#21c43e3ee182824e92e2b25f1d3c03ed47f9c02b" -dependencies = [ - "allocator-api2", - "bumpalo", - "hashbrown 0.14.5", - "log", - "rustc-hash", - "smallvec", -] - [[package]] name = "regex-syntax" version = "0.8.5" @@ -602,12 +573,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - [[package]] name = "rustc_version" version = "0.4.1" @@ -619,9 +584,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "log", "once_cell", diff --git a/sysdata/programs/ps2_driver/src/bits.hb b/sysdata/programs/ps2_driver/src/bits.hb new file mode 100644 index 00000000..3a8afebd --- /dev/null +++ b/sysdata/programs/ps2_driver/src/bits.hb @@ -0,0 +1,26 @@ +//Do not question. + +$bit0 := fn(value: u8): bool { + return (value & 0x1) > 0 +} +$bit1 := fn(value: u8): bool { + return (value & 0x2) > 0 +} +$bit2 := fn(value: u8): bool { + return (value & 0x4) > 0 +} +$bit3 := fn(value: u8): bool { + return (value & 0x8) > 0 +} +$bit4 := fn(value: u8): bool { + return (value & 0x10) > 0 +} +$bit5 := fn(value: u8): bool { + return (value & 0x20) > 0 +} +$bit6 := fn(value: u8): bool { + return (value & 0x40) > 0 +} +$bit7 := fn(value: u8): bool { + return (value & 0x80) > 0 +} \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb new file mode 100644 index 00000000..00a83f61 --- /dev/null +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -0,0 +1,53 @@ +.{memory, log} := @use("../../../libraries/stn/src/lib.hb"); +.{bit5} := @use("bits.hb") + +init := fn(): void { + memory.outb(0x64, 0xAD) + memory.outb(0x64, 0xA7) + //Disables ports to make sure that they won't interfere with the setup process. + + loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) + //Flushes any output because apperantly that might interfere with stuff. + + memory.outb(0x64, 0xA8) + //Enables port 2. + memory.outb(0x64, 0x20) + //Gimme configuration byte. + loop if (memory.inb(0x64) & 1) == 1 break + ports[1].exists = bit5(memory.inb(0x60)) == false + if ports[1].exists { + memory.outb(0x64, 0xA7) + } + + loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) + //Flushes any output because apperantly that might interfere with stuff. + + memory.outb(0x64, 0xAB) + loop if (memory.inb(0x64) & 1) == 1 break + ports[0].exists = memory.inb(0x60) == 0x0 + //Test port 1. + + if ports[1].exists { + memory.outb(0x64, 0xA9) + loop if (memory.inb(0x64) & 1) == 1 break + ports[1].exists = memory.inb(0x60) == 0x0 + } + //Test port 2. + + if (ports[0].exists | ports[1].exists) == false { + log.error("No ports detected! No input will be processed! Cannot handle this!\0") + } + + if ports[0].exists { + log.info("Port 1 exists.\0") + memory.outb(0x64, 0xAE) + //Enables port 1. + ports[0].commands_queued = 1 + } + if ports[1].exists { + log.info("Port 2 exists.\0") + memory.outb(0x64, 0xA8) + //Enables port 2. + ports[1].commands_queued = 1 + } +} \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index 21946cf2..a62e9e10 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -1,132 +1,6 @@ .{memory, log, string} := @use("../../../libraries/stn/src/lib.hb") format_page := memory.dangling(u8) -DeviceID := struct {value: u16} - -$Mouse3Button := DeviceID.(0x0) -$MouseScrollwheel := DeviceID.(0x3) -$Mouse5Button := DeviceID.(0x4) -$Spacesaver := DeviceID.(0x84AB) -$Keyboard122Key := DeviceID.(0x86AB) -$KeyboardJapaneseG := DeviceID.(0x90AB) -$KeyboardJapanesep := DeviceID.(0x91AB) -$KeyboardJapaneseA := DeviceID.(0x92AB) -$KeyboardNCDSun := DeviceID.(0xA1AC) -$NoDevice := DeviceID.(0xFFFF) - -State := struct {value: u8} -$Recive := State.(0) -$Reboot := State.(1) -$GetID := State.(2) -$TurnOnStreaming := State.(3) - -Port := struct {exists: bool, device: DeviceID, commands_queued: u8, command_queue: [u8; 8], awaiting_ack: bool, state: State, expecting: bool, expecting_data: u8} - -$check_bit := fn(value: u8, bit: u8, state: u8): bool { - return (value >> bit & 1) == state -} - -ports := [Port].(.(true, NoDevice, 1, .(0xFF, 0, 0, 0, 0, 0, 0, 0), false, Reboot, false, 0x0), .(true, NoDevice, 1, .(0xFF, 0, 0, 0, 0, 0, 0, 0), false, Reboot, false, 0x0)) - -initialize_controller := fn(): void { - memory.outb(0x64, 0xAD) - memory.outb(0x64, 0xA7) - //Disables ports to make sure that they won't interfere with the setup process. - - loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) - //Flushes any output because apperantly that might interfere with stuff. - - memory.outb(0x64, 0xA8) - //Enables port 2. - memory.outb(0x64, 0x20) - //Gimme configuration byte. - loop if (memory.inb(0x64) & 1) == 1 break - ports[1].exists = check_bit(memory.inb(0x60), 5, 0) - if ports[1].exists { - memory.outb(0x64, 0xA7) - } - - loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) - //Flushes any output because apperantly that might interfere with stuff. - - memory.outb(0x64, 0xAB) - loop if (memory.inb(0x64) & 1) == 1 break - ports[0].exists = memory.inb(0x60) == 0x0 - //Test port 1. - - if ports[1].exists { - memory.outb(0x64, 0xA9) - loop if (memory.inb(0x64) & 1) == 1 break - ports[1].exists = memory.inb(0x60) == 0x0 - } - //Test port 2. - - if (ports[0].exists | ports[1].exists) == false { - log.error("No ports detected! No input will be processed! Cannot handle this!\0") - } - - if ports[0].exists { - log.info("Port 1 exists.\0") - memory.outb(0x64, 0xAE) - //Enables port 1. - ports[0].commands_queued = 1 - } - if ports[1].exists { - log.info("Port 2 exists.\0") - memory.outb(0x64, 0xA8) - //Enables port 2. - ports[1].commands_queued = 1 - } -} - -handle_input := fn(port: uint, input: u8): void { - if input == 0xAA { - log.info("Device rebooted!\0") - log.info(string.display_int(@intcast(port + 1), format_page, 16)) - ports[port].state = Recive - } else if ports[port].state.value == Recive.value { - } -} - main := fn(): void { format_page = memory.alloc(u8, 1024) - - @inline(initialize_controller) - - loop { - port_info := memory.inb(0x64) - //Enables port 1. - if (port_info & 0x40) > 0 { - log.error("Timeout error! Cannot handle these!\0") - } - if (port_info & 0x80) > 0 { - log.error("Parity error! Cannot handle these!\0") - } - - if (port_info & 1) == 0 { - if ports[0].exists & ports[0].commands_queued > 0 { - memory.outb(0x60, ports[0].command_queue) - ports[0].commands_queued -= 1 - } - if ports[1].exists & ports[1].commands_queued > 0 { - memory.outb(0x64, 0xD4) - memory.outb(0x60, ports[1].command_queue) - ports[1].commands_queued -= 1 - } - } - - port := 0 - if ports[1].exists { - port = port_info >> 5 & 1 - } - - if ports[port].exists { - input := memory.inb(0x60) - if ports[port].awaiting_ack & input == 0xFA { - ports[port].awaiting_ack = false - } else { - @inline(handle_input, port, input) - } - } - } } \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/main_legacy.hb b/sysdata/programs/ps2_driver/src/main_legacy.hb new file mode 100644 index 00000000..04b8228a --- /dev/null +++ b/sysdata/programs/ps2_driver/src/main_legacy.hb @@ -0,0 +1,144 @@ +.{memory, log, string} := @use("../../../libraries/stn/src/lib.hb") +format_page := memory.dangling(u8) + +DeviceID := struct {value: u16} + +$Mouse3Button := DeviceID.(0x0) +$MouseScrollwheel := DeviceID.(0x3) +$Mouse5Button := DeviceID.(0x4) +$Spacesaver := DeviceID.(0x84AB) +$Keyboard122Key := DeviceID.(0x86AB) +$KeyboardJapaneseG := DeviceID.(0x90AB) +$KeyboardJapanesep := DeviceID.(0x91AB) +$KeyboardJapaneseA := DeviceID.(0x92AB) +$KeyboardNCDSun := DeviceID.(0xA1AC) +$NoDevice := DeviceID.(0xFFFF) + +State := struct {value: u8} +$Recive := State.(0) +$Reboot := State.(1) +$GetID := State.(2) +$TurnOnStreaming := State.(3) + +CommandQueue := struct {queue: [u8; 8]} + +Port := struct {exists: bool, device: DeviceID, commands_queued: u8, command_queue: [u8; 8], command_index: u8, awaiting_acks: u8, state: State, expecting: bool} + +$check_bit := fn(value: u8, bit: u8, state: u8): bool { + return (value >> bit & 1) == state +} + +ports := [Port].(.(true, NoDevice, 1, .(0xFF, 0, 0, 0, 0, 0, 0, 0), 0, 0, Reboot, false), .(true, NoDevice, 1, .(0xFF, 0, 0, 0, 0, 0, 0, 0), 0, 0, Reboot, false)) + +$send_byte := fn(port: uint, value: u8): void { + //Sending over 8 bytes will cause and overflow, don't do pwease? + ports[port].command_queue[(ports[port].command_index + 1) % 8] = value + ports[port].awaiting_acks += 1 +} + +initialize_controller := fn(): void { + memory.outb(0x64, 0xAD) + memory.outb(0x64, 0xA7) + //Disables ports to make sure that they won't interfere with the setup process. + + loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) + //Flushes any output because apperantly that might interfere with stuff. + + memory.outb(0x64, 0xA8) + //Enables port 2. + memory.outb(0x64, 0x20) + //Gimme configuration byte. + loop if (memory.inb(0x64) & 1) == 1 break + ports[1].exists = check_bit(memory.inb(0x60), 5, 0) + if ports[1].exists { + memory.outb(0x64, 0xA7) + } + + loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) + //Flushes any output because apperantly that might interfere with stuff. + + memory.outb(0x64, 0xAB) + loop if (memory.inb(0x64) & 1) == 1 break + ports[0].exists = memory.inb(0x60) == 0x0 + //Test port 1. + + if ports[1].exists { + memory.outb(0x64, 0xA9) + loop if (memory.inb(0x64) & 1) == 1 break + ports[1].exists = memory.inb(0x60) == 0x0 + } + //Test port 2. + + if (ports[0].exists | ports[1].exists) == false { + log.error("No ports detected! No input will be processed! Cannot handle this!\0") + } + + if ports[0].exists { + log.info("Port 1 exists.\0") + memory.outb(0x64, 0xAE) + //Enables port 1. + ports[0].commands_queued = 1 + } + if ports[1].exists { + log.info("Port 2 exists.\0") + memory.outb(0x64, 0xA8) + //Enables port 2. + ports[1].commands_queued = 1 + } +} + +handle_input := fn(port: uint, input: u8): void { + if input == 0xAA { + log.info("Device rebooted!\0") + log.info(string.display_int(@intcast(port + 1), format_page, 16)) + ports[port].state = GetID + send_byte(port, 0xF2) + //Get ID + } else if ports[port].state.value == Recive.value { + } +} + +main := fn(): void { + format_page = memory.alloc(u8, 1024) + + @inline(initialize_controller) + + loop { + port_info := memory.inb(0x64) + //Enables port 1. + if (port_info & 0x40) > 0 { + log.error("Timeout error! Cannot handle these!\0") + } + if (port_info & 0x80) > 0 { + log.error("Parity error! Cannot handle these!\0") + } + + if (port_info & 1) == 0 { + if ports[0].exists & ports[0].commands_queued > 0 { + memory.outb(0x60, ports[0].command_queue[ports[0].command_index]) + ports[0].commands_queued -= 1 + ports[0].command_index = (ports[0].command_index + 1) % 8 + } + if ports[1].exists & ports[1].commands_queued > 0 { + memory.outb(0x64, 0xD4) + memory.outb(0x60, ports[1].command_queue[ports[1].command_index]) + ports[1].commands_queued -= 1 + ports[1].command_index = (ports[1].command_index + 1) % 8 + } + } + + port := 0 + if ports[1].exists { + port = port_info >> 5 & 1 + } + + if ports[port].exists { + input := memory.inb(0x60) + if ports[port].awaiting_acks > 0 & input == 0xFA { + ports[port].awaiting_acks -= 1 + } else { + @inline(handle_input, port, input) + } + } + } +} \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/port.hb b/sysdata/programs/ps2_driver/src/port.hb new file mode 100644 index 00000000..65918402 --- /dev/null +++ b/sysdata/programs/ps2_driver/src/port.hb @@ -0,0 +1,10 @@ +Port := struct { + exists: bool + device: DeviceID + commands_queued: u8 + command_queue: [u8; 8] + command_index: u8 + awaiting_acks: u8 + state: State + expecting: bool +} \ No newline at end of file From 11976b752f13412faf5dbbbfbb383ae057fe7d5e Mon Sep 17 00:00:00 2001 From: peony Date: Sat, 16 Nov 2024 22:56:00 +0100 Subject: [PATCH 14/29] PS/2 driver going well (it still doesn't work) --- sysdata/programs/ps2_driver/src/controller.hb | 59 ++++++++++++------- sysdata/programs/ps2_driver/src/devices.hb | 12 ++++ sysdata/programs/ps2_driver/src/port.hb | 2 + 3 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 sysdata/programs/ps2_driver/src/devices.hb diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb index 00a83f61..a6826da4 100644 --- a/sysdata/programs/ps2_driver/src/controller.hb +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -1,35 +1,52 @@ .{memory, log} := @use("../../../libraries/stn/src/lib.hb"); -.{bit5} := @use("bits.hb") +.{bit0, bit5} := @use("bits.hb") + +$disable_port1 := fn(): void memory.outb(0x64, 0xAD) +$enable_port1 := fn(): void memory.outb(0x64, 0xAE) +$disable_port2 := fn(): void memory.outb(0x64, 0xA7) +$enable_port2 := fn(): void memory.outb(0x64, 0xA8) + +//TODO test functions +/*test_port1 := fn(): bool { + +}*/ + +get_config_byte := fn(): u8 { + memory.outb(0x64, 0x20) + loop if has_input(get_info()) break + return memory.inb(0x60) +} + +Info := struct {d: u8} + +$get_info := fn(): u8 return .(memory.inb(0x64)) +$has_input := fn(info: Info): bool return bit0(info.d) + +flush_input := fn(): void { + loop if has_input(get_info()) == false break else memory.inb(0x60) +} init := fn(): void { - memory.outb(0x64, 0xAD) - memory.outb(0x64, 0xA7) + disable_port1() + disable_port2() //Disables ports to make sure that they won't interfere with the setup process. - loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) - //Flushes any output because apperantly that might interfere with stuff. + flush_input() - memory.outb(0x64, 0xA8) - //Enables port 2. - memory.outb(0x64, 0x20) - //Gimme configuration byte. - loop if (memory.inb(0x64) & 1) == 1 break - ports[1].exists = bit5(memory.inb(0x60)) == false - if ports[1].exists { - memory.outb(0x64, 0xA7) - } + enable_port2() + ports[1].exists = bit5(@inline(get_config_byte)) == false + disable_port2() - loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) - //Flushes any output because apperantly that might interfere with stuff. + flush_input() memory.outb(0x64, 0xAB) - loop if (memory.inb(0x64) & 1) == 1 break + loop if has_input(get_info()) break ports[0].exists = memory.inb(0x60) == 0x0 //Test port 1. if ports[1].exists { memory.outb(0x64, 0xA9) - loop if (memory.inb(0x64) & 1) == 1 break + loop if has_input(get_info()) break ports[1].exists = memory.inb(0x60) == 0x0 } //Test port 2. @@ -40,14 +57,12 @@ init := fn(): void { if ports[0].exists { log.info("Port 1 exists.\0") - memory.outb(0x64, 0xAE) - //Enables port 1. + enable_port1() ports[0].commands_queued = 1 } if ports[1].exists { log.info("Port 2 exists.\0") - memory.outb(0x64, 0xA8) - //Enables port 2. + enable_port2() ports[1].commands_queued = 1 } } \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/devices.hb b/sysdata/programs/ps2_driver/src/devices.hb new file mode 100644 index 00000000..db92593a --- /dev/null +++ b/sysdata/programs/ps2_driver/src/devices.hb @@ -0,0 +1,12 @@ +DeviceID := struct {value: u16} + +$Mouse3Button := DeviceID.(0x0) +$MouseScrollwheel := DeviceID.(0x3) +$Mouse5Button := DeviceID.(0x4) +$Spacesaver := DeviceID.(0x84AB) +$Keyboard122Key := DeviceID.(0x86AB) +$KeyboardJapaneseG := DeviceID.(0x90AB) +$KeyboardJapanesep := DeviceID.(0x91AB) +$KeyboardJapaneseA := DeviceID.(0x92AB) +$KeyboardNCDSun := DeviceID.(0xA1AC) +$NoDevice := DeviceID.(0xFFFF) \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/port.hb b/sysdata/programs/ps2_driver/src/port.hb index 65918402..1bcc674e 100644 --- a/sysdata/programs/ps2_driver/src/port.hb +++ b/sysdata/programs/ps2_driver/src/port.hb @@ -1,3 +1,5 @@ +.{DeviceID} := @use("devices.hb") + Port := struct { exists: bool device: DeviceID From 284aa5a5e647848358250a278d27656779c7ff52 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 17 Nov 2024 11:17:32 +0100 Subject: [PATCH 15/29] PS/2 is so close --- sysdata/programs/ps2_driver/src/controller.hb | 63 ++++++++++++------- sysdata/programs/ps2_driver/src/main.hb | 3 + .../programs/ps2_driver/src/main_legacy.hb | 2 +- sysdata/programs/ps2_driver/src/port.hb | 30 +++++---- 4 files changed, 64 insertions(+), 34 deletions(-) diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb index a6826da4..64785877 100644 --- a/sysdata/programs/ps2_driver/src/controller.hb +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -1,31 +1,56 @@ .{memory, log} := @use("../../../libraries/stn/src/lib.hb"); -.{bit0, bit5} := @use("bits.hb") +.{bit0, bit5, bit6, bit7} := @use("bits.hb"); +.{Port, port_at_startup} := @use("port.hb") $disable_port1 := fn(): void memory.outb(0x64, 0xAD) $enable_port1 := fn(): void memory.outb(0x64, 0xAE) $disable_port2 := fn(): void memory.outb(0x64, 0xA7) $enable_port2 := fn(): void memory.outb(0x64, 0xA8) -//TODO test functions -/*test_port1 := fn(): bool { +test_port1 := fn(): bool { + memory.outb(0x64, 0xAB) + loop if has_input(get_info()) break + input := get_input() + return input == 0x0 +} -}*/ +test_port2 := fn(): bool { + memory.outb(0x64, 0xA9) + loop if has_input(get_info()) break + input := get_input() + return input == 0x0 +} get_config_byte := fn(): u8 { - memory.outb(0x64, 0x20) + memory.outb(0x64, 0x20) loop if has_input(get_info()) break - return memory.inb(0x60) + return get_input() } Info := struct {d: u8} $get_info := fn(): u8 return .(memory.inb(0x64)) $has_input := fn(info: Info): bool return bit0(info.d) +$timed_out := fn(info: Info): bool return bit6(info.d) +$check_parity := fn(info: Info): bool return bit7(info.d) +get_port := fn(info: Info): ^Port { + if bit5(info.d) { + return &port2 + } else { + return &port1 + } +} + +$get_input := fn(): u8 return memory.inb(0x60) +$write_out := fn(data: u8): void memory.outb(0x60, data) flush_input := fn(): void { - loop if has_input(get_info()) == false break else memory.inb(0x60) + loop if has_input(get_info()) == false break else get_info() } +port1 := port_at_startup +port2 := port_at_startup + init := fn(): void { disable_port1() disable_port2() @@ -34,35 +59,29 @@ init := fn(): void { flush_input() enable_port2() - ports[1].exists = bit5(@inline(get_config_byte)) == false + port2.exists = bit5(@inline(get_config_byte)) == false disable_port2() flush_input() - memory.outb(0x64, 0xAB) - loop if has_input(get_info()) break - ports[0].exists = memory.inb(0x60) == 0x0 - //Test port 1. + port1.exists = test_port1() - if ports[1].exists { - memory.outb(0x64, 0xA9) - loop if has_input(get_info()) break - ports[1].exists = memory.inb(0x60) == 0x0 + if port2.exists { + port2.exists = test_port2() } - //Test port 2. - if (ports[0].exists | ports[1].exists) == false { + if (port1.exists | port2.exists) == false { log.error("No ports detected! No input will be processed! Cannot handle this!\0") } - if ports[0].exists { + if port1.exists { log.info("Port 1 exists.\0") enable_port1() - ports[0].commands_queued = 1 + port1.commands.length = 1 } - if ports[1].exists { + if port2.exists { log.info("Port 2 exists.\0") enable_port2() - ports[1].commands_queued = 1 + port2.commands.length = 1 } } \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index a62e9e10..8362c4fc 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -1,6 +1,9 @@ .{memory, log, string} := @use("../../../libraries/stn/src/lib.hb") +controller := @use("controller.hb") format_page := memory.dangling(u8) main := fn(): void { format_page = memory.alloc(u8, 1024) + + controller.init() } \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/main_legacy.hb b/sysdata/programs/ps2_driver/src/main_legacy.hb index 04b8228a..5f335593 100644 --- a/sysdata/programs/ps2_driver/src/main_legacy.hb +++ b/sysdata/programs/ps2_driver/src/main_legacy.hb @@ -105,7 +105,7 @@ main := fn(): void { loop { port_info := memory.inb(0x64) - //Enables port 1. + if (port_info & 0x40) > 0 { log.error("Timeout error! Cannot handle these!\0") } diff --git a/sysdata/programs/ps2_driver/src/port.hb b/sysdata/programs/ps2_driver/src/port.hb index 1bcc674e..5f270c18 100644 --- a/sysdata/programs/ps2_driver/src/port.hb +++ b/sysdata/programs/ps2_driver/src/port.hb @@ -1,12 +1,20 @@ -.{DeviceID} := @use("devices.hb") +.{DeviceID, NoDevice} := @use("devices.hb") -Port := struct { - exists: bool - device: DeviceID - commands_queued: u8 - command_queue: [u8; 8] - command_index: u8 - awaiting_acks: u8 - state: State - expecting: bool -} \ No newline at end of file +State := struct {s: u8} +$Reboot := State.(0) + +CommandQueue := packed struct {queue: [u8; 8], length: u8, current_index: u8} + +Port := packed struct { + exists: bool, + device: DeviceID, + commands: CommandQueue, + state: State, +} + +$port_at_startup := Port.( + true, + NoDevice, + .(.(0xFF, 0, 0, 0, 0, 0, 0, 0), 1, 0), + Reboot, +) \ No newline at end of file From 23b45b1887b5a661112b7102f5172a2e4d0ecd38 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 17 Nov 2024 17:57:06 +0100 Subject: [PATCH 16/29] Driver workkkk --- Cargo.lock | 6 ++-- sysdata/programs/ps2_driver/README.md | 1 + sysdata/programs/ps2_driver/src/controller.hb | 22 ++++++++----- sysdata/programs/ps2_driver/src/main.hb | 31 ++++++++++++++++++- sysdata/programs/ps2_driver/src/port.hb | 13 ++++---- sysdata/system_config.toml | 4 +-- 6 files changed, 57 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d4cd9e7..a336be8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,12 +213,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#12bb7029b4bafd1edff77ed9a12888374cc7f8be" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#397b2a4b1b7c088f379f32d846e235c1286e17e0" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#12bb7029b4bafd1edff77ed9a12888374cc7f8be" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#397b2a4b1b7c088f379f32d846e235c1286e17e0" dependencies = [ "hashbrown", "hbbytecode", @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#12bb7029b4bafd1edff77ed9a12888374cc7f8be" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#397b2a4b1b7c088f379f32d846e235c1286e17e0" dependencies = [ "hbbytecode", ] diff --git a/sysdata/programs/ps2_driver/README.md b/sysdata/programs/ps2_driver/README.md index c0a3d838..c3116537 100644 --- a/sysdata/programs/ps2_driver/README.md +++ b/sysdata/programs/ps2_driver/README.md @@ -10,3 +10,4 @@ Anyone who works on this should work to keep this list as small as possible/remo - Both PS/2 ports being broken doesn't need handling. - One PS/2 port being broken doesn't need special attention. - PS/2 controller doesn't need to perform a self-check. +- Stack overflows aren't a thing \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb index 64785877..2c6af892 100644 --- a/sysdata/programs/ps2_driver/src/controller.hb +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -1,5 +1,5 @@ .{memory, log} := @use("../../../libraries/stn/src/lib.hb"); -.{bit0, bit5, bit6, bit7} := @use("bits.hb"); +.{bit0, bit1, bit5, bit6, bit7} := @use("bits.hb"); .{Port, port_at_startup} := @use("port.hb") $disable_port1 := fn(): void memory.outb(0x64, 0xAD) @@ -29,10 +29,12 @@ get_config_byte := fn(): u8 { Info := struct {d: u8} -$get_info := fn(): u8 return .(memory.inb(0x64)) -$has_input := fn(info: Info): bool return bit0(info.d) -$timed_out := fn(info: Info): bool return bit6(info.d) -$check_parity := fn(info: Info): bool return bit7(info.d) +$get_info := fn(): Info return .(memory.inb(0x64)) +//inline when can +has_input := fn(info: Info): bool return bit0(info.d) +can_send := fn(info: Info): bool return bit1(info.d) == false +timed_out := fn(info: Info): bool return bit6(info.d) +check_parity := fn(info: Info): bool return bit7(info.d) get_port := fn(info: Info): ^Port { if bit5(info.d) { return &port2 @@ -41,6 +43,14 @@ get_port := fn(info: Info): ^Port { } } +send_byte := fn(port: ^Port, byte: u8): void { + if port == port2 { + memory.outb(0x64, 0xD4) + } + loop if can_send(get_info()) break + memory.outb(0x60, byte) +} + $get_input := fn(): u8 return memory.inb(0x60) $write_out := fn(data: u8): void memory.outb(0x60, data) @@ -77,11 +87,9 @@ init := fn(): void { if port1.exists { log.info("Port 1 exists.\0") enable_port1() - port1.commands.length = 1 } if port2.exists { log.info("Port 2 exists.\0") enable_port2() - port2.commands.length = 1 } } \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index 8362c4fc..ce6bd6b4 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -1,9 +1,38 @@ -.{memory, log, string} := @use("../../../libraries/stn/src/lib.hb") +.{memory, log, string} := @use("../../../libraries/stn/src/lib.hb"); +.{Mouse3Button} := @use("devices.hb") controller := @use("controller.hb") format_page := memory.dangling(u8) +info := controller.Info.(0) + +process := fn(port: ^controller.Port): bool { +} + +check_complete := fn(port: ^controller.Port): bool { +} + main := fn(): void { format_page = memory.alloc(u8, 1024) controller.init() + + loop { + info = controller.get_info() + + if controller.timed_out(info) { + log.error("Timeout error! Cannot handle these!\0") + } + if controller.check_parity(info) { + log.error("Parity error! Cannot handle these!\0") + } + + if controller.has_input(info) { + port := controller.get_port(info) + port.packet[port.packet_length] = controller.get_input() + port.packet_length += 1 + if @inline(check_complete, port) { + process(port) + } + } + } } \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/port.hb b/sysdata/programs/ps2_driver/src/port.hb index 5f270c18..852d0d6d 100644 --- a/sysdata/programs/ps2_driver/src/port.hb +++ b/sysdata/programs/ps2_driver/src/port.hb @@ -1,20 +1,19 @@ .{DeviceID, NoDevice} := @use("devices.hb") State := struct {s: u8} -$Reboot := State.(0) - -CommandQueue := packed struct {queue: [u8; 8], length: u8, current_index: u8} +$Recive := State.(0) +$Reboot := State.(1) Port := packed struct { exists: bool, device: DeviceID, - commands: CommandQueue, - state: State, + packet: [u8; 4], + packet_length: u8, } $port_at_startup := Port.( true, NoDevice, - .(.(0xFF, 0, 0, 0, 0, 0, 0, 0), 1, 0), - Reboot, + .(0, 0, 0, 0), + 0, ) \ No newline at end of file diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 6bb34b7f..89830c95 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -28,8 +28,8 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.horizon] # path = "boot:///horizon.hbf" -[boot.limine.ableos.modules.ps2_mouse_driver] -path = "boot:///ps2_mouse_driver.hbf" +# [boot.limine.ableos.modules.ps2_mouse_driver] +# path = "boot:///ps2_mouse_driver.hbf" # [boot.limine.ableos.modules.ps2_keyboard_driver] # path = "boot:///ps2_keyboard_driver.hbf" From 90a97cd16000899b015a6af03111927c128498be Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 17 Nov 2024 19:11:13 +0100 Subject: [PATCH 17/29] more work --- Cargo.lock | 6 +++--- sysdata/programs/ps2_driver/src/controller.hb | 6 +++--- sysdata/programs/ps2_driver/src/main.hb | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a336be8c..1eaf3cc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,12 +213,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#397b2a4b1b7c088f379f32d846e235c1286e17e0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#fe5a8631f66e7acde8707a68ad25074ab5b1f408" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#397b2a4b1b7c088f379f32d846e235c1286e17e0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#fe5a8631f66e7acde8707a68ad25074ab5b1f408" dependencies = [ "hashbrown", "hbbytecode", @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#397b2a4b1b7c088f379f32d846e235c1286e17e0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#fe5a8631f66e7acde8707a68ad25074ab5b1f408" dependencies = [ "hbbytecode", ] diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb index 2c6af892..38863b15 100644 --- a/sysdata/programs/ps2_driver/src/controller.hb +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -2,6 +2,9 @@ .{bit0, bit1, bit5, bit6, bit7} := @use("bits.hb"); .{Port, port_at_startup} := @use("port.hb") +port1 := port_at_startup +port2 := port_at_startup + $disable_port1 := fn(): void memory.outb(0x64, 0xAD) $enable_port1 := fn(): void memory.outb(0x64, 0xAE) $disable_port2 := fn(): void memory.outb(0x64, 0xA7) @@ -58,9 +61,6 @@ flush_input := fn(): void { loop if has_input(get_info()) == false break else get_info() } -port1 := port_at_startup -port2 := port_at_startup - init := fn(): void { disable_port1() disable_port2() diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index ce6bd6b4..362c1016 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -5,7 +5,8 @@ format_page := memory.dangling(u8) info := controller.Info.(0) -process := fn(port: ^controller.Port): bool { +process := fn(port: ^controller.Port): void { + } check_complete := fn(port: ^controller.Port): bool { From 2fdede7199363f1adf021a26bb17e9ace9a138d4 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 17 Nov 2024 21:30:58 +0100 Subject: [PATCH 18/29] PS/2 workkkk --- Cargo.lock | 6 +- sysdata/programs/ps2_driver/README.md | 8 +- sysdata/programs/ps2_driver/src/controller.hb | 6 +- sysdata/programs/ps2_driver/src/devices.hb | 23 +-- sysdata/programs/ps2_driver/src/main.hb | 46 +++++- .../programs/ps2_driver/src/main_legacy.hb | 144 ------------------ sysdata/programs/ps2_driver/src/port.hb | 10 +- 7 files changed, 74 insertions(+), 169 deletions(-) delete mode 100644 sysdata/programs/ps2_driver/src/main_legacy.hb diff --git a/Cargo.lock b/Cargo.lock index 1eaf3cc5..c82d4622 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,12 +213,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#fe5a8631f66e7acde8707a68ad25074ab5b1f408" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#542c69fd6042a4b48462199c4391761bfe1b7c2e" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#fe5a8631f66e7acde8707a68ad25074ab5b1f408" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#542c69fd6042a4b48462199c4391761bfe1b7c2e" dependencies = [ "hashbrown", "hbbytecode", @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#fe5a8631f66e7acde8707a68ad25074ab5b1f408" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#542c69fd6042a4b48462199c4391761bfe1b7c2e" dependencies = [ "hbbytecode", ] diff --git a/sysdata/programs/ps2_driver/README.md b/sysdata/programs/ps2_driver/README.md index c3116537..61936064 100644 --- a/sysdata/programs/ps2_driver/README.md +++ b/sysdata/programs/ps2_driver/README.md @@ -10,4 +10,10 @@ Anyone who works on this should work to keep this list as small as possible/remo - Both PS/2 ports being broken doesn't need handling. - One PS/2 port being broken doesn't need special attention. - PS/2 controller doesn't need to perform a self-check. -- Stack overflows aren't a thing \ No newline at end of file +- These DeviceIDs never exist: + - 0xFFFD + - 0xFFFE + - 0xFFFF + - 0x01xx + - 0x03xx + - 0x04xx \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb index 38863b15..35fb4fed 100644 --- a/sysdata/programs/ps2_driver/src/controller.hb +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -1,9 +1,9 @@ .{memory, log} := @use("../../../libraries/stn/src/lib.hb"); .{bit0, bit1, bit5, bit6, bit7} := @use("bits.hb"); -.{Port, port_at_startup} := @use("port.hb") +.{Port, PORT_AT_STARTUP} := @use("port.hb") -port1 := port_at_startup -port2 := port_at_startup +port1 := PORT_AT_STARTUP +port2 := PORT_AT_STARTUP $disable_port1 := fn(): void memory.outb(0x64, 0xAD) $enable_port1 := fn(): void memory.outb(0x64, 0xAE) diff --git a/sysdata/programs/ps2_driver/src/devices.hb b/sysdata/programs/ps2_driver/src/devices.hb index db92593a..7cfbdb01 100644 --- a/sysdata/programs/ps2_driver/src/devices.hb +++ b/sysdata/programs/ps2_driver/src/devices.hb @@ -1,12 +1,15 @@ DeviceID := struct {value: u16} -$Mouse3Button := DeviceID.(0x0) -$MouseScrollwheel := DeviceID.(0x3) -$Mouse5Button := DeviceID.(0x4) -$Spacesaver := DeviceID.(0x84AB) -$Keyboard122Key := DeviceID.(0x86AB) -$KeyboardJapaneseG := DeviceID.(0x90AB) -$KeyboardJapanesep := DeviceID.(0x91AB) -$KeyboardJapaneseA := DeviceID.(0x92AB) -$KeyboardNCDSun := DeviceID.(0xA1AC) -$NoDevice := DeviceID.(0xFFFF) \ No newline at end of file +$MOUSE_3_BUTTON := DeviceID.(0x0) +$MOUSE_SCROLLWHEEL := DeviceID.(0x3) +$MOUSE_5_BUTTON := DeviceID.(0x4) +$KEYBOARD_SPACESAVER := DeviceID.(0x84AB) +$KEYBOARD_122_KEY := DeviceID.(0x86AB) +$KEYBOARD_JAPANESE_G := DeviceID.(0x90AB) +$KEYBOARD_JAPANESE_P := DeviceID.(0x91AB) +$KEYBOARD_JAPANESE_A := DeviceID.(0x92AB) +$KEYBOARD_NCD_SUN := DeviceID.(0xA1AC) + +$MOUSE_INIT_1 := DeviceID.(0xFFFD) +$MOUSE_INIT_2 := DeviceID.(0xFFFE) +$NO_DEVICE := DeviceID.(0xFFFF) \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index 362c1016..32b786a7 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -1,15 +1,49 @@ -.{memory, log, string} := @use("../../../libraries/stn/src/lib.hb"); -.{Mouse3Button} := @use("devices.hb") +.{memory, log, string} := @use("../../../libraries/stn/src/lib.hb") +devices := @use("devices.hb") controller := @use("controller.hb") format_page := memory.dangling(u8) info := controller.Info.(0) process := fn(port: ^controller.Port): void { - + if port.device == devices.MOUSE_3_BUTTON { + } else if port.device == devices.MOUSE_INIT_1 { + port.device.value = port.packet[0] | port.packet[1] << 8 + if port.device == devices.MOUSE_SCROLLWHEEL { + port.device = devices.MOUSE_INIT_2 + } + } else if port.device == devices.MOUSE_INIT_2 { + port.device.value = port.packet[0] | port.packet[1] << 8 + } else if port.device == devices.NO_DEVICE { + if port.packet_length == 1 { + port.device.value = port.packet[0] + } else { + port.device.value = port.packet[1] | port.packet[0] << 8 + } + log.info("Identified device!\0") + log.info(string.display_int(port.device.value, format_page, 16)) + } } check_complete := fn(port: ^controller.Port): bool { + last_value := port.packet[port.packet_length - 1] + if port.device == devices.NO_DEVICE { + if last_value == 0 | last_value == 3 | last_value == 4 { + return true + } else if port.packet_length == 2 { + return true + } + } + if port.device == devices.MOUSE_3_BUTTON { + if port.packet_length == 3 return true + } + if port.device == devices.MOUSE_SCROLLWHEEL | port.device == devices.MOUSE_5_BUTTON { + if port.packet_length == 4 return true + } else { + log.error("Very unexpected error. Cannot handle this!\0") + return true + } + return false } main := fn(): void { @@ -29,7 +63,11 @@ main := fn(): void { if controller.has_input(info) { port := controller.get_port(info) - port.packet[port.packet_length] = controller.get_input() + input := controller.get_input() + if input == 0xAA & port.can_hot_plug { + port.device = devices.NO_DEVICE + } + port.packet[port.packet_length] = input port.packet_length += 1 if @inline(check_complete, port) { process(port) diff --git a/sysdata/programs/ps2_driver/src/main_legacy.hb b/sysdata/programs/ps2_driver/src/main_legacy.hb deleted file mode 100644 index 5f335593..00000000 --- a/sysdata/programs/ps2_driver/src/main_legacy.hb +++ /dev/null @@ -1,144 +0,0 @@ -.{memory, log, string} := @use("../../../libraries/stn/src/lib.hb") -format_page := memory.dangling(u8) - -DeviceID := struct {value: u16} - -$Mouse3Button := DeviceID.(0x0) -$MouseScrollwheel := DeviceID.(0x3) -$Mouse5Button := DeviceID.(0x4) -$Spacesaver := DeviceID.(0x84AB) -$Keyboard122Key := DeviceID.(0x86AB) -$KeyboardJapaneseG := DeviceID.(0x90AB) -$KeyboardJapanesep := DeviceID.(0x91AB) -$KeyboardJapaneseA := DeviceID.(0x92AB) -$KeyboardNCDSun := DeviceID.(0xA1AC) -$NoDevice := DeviceID.(0xFFFF) - -State := struct {value: u8} -$Recive := State.(0) -$Reboot := State.(1) -$GetID := State.(2) -$TurnOnStreaming := State.(3) - -CommandQueue := struct {queue: [u8; 8]} - -Port := struct {exists: bool, device: DeviceID, commands_queued: u8, command_queue: [u8; 8], command_index: u8, awaiting_acks: u8, state: State, expecting: bool} - -$check_bit := fn(value: u8, bit: u8, state: u8): bool { - return (value >> bit & 1) == state -} - -ports := [Port].(.(true, NoDevice, 1, .(0xFF, 0, 0, 0, 0, 0, 0, 0), 0, 0, Reboot, false), .(true, NoDevice, 1, .(0xFF, 0, 0, 0, 0, 0, 0, 0), 0, 0, Reboot, false)) - -$send_byte := fn(port: uint, value: u8): void { - //Sending over 8 bytes will cause and overflow, don't do pwease? - ports[port].command_queue[(ports[port].command_index + 1) % 8] = value - ports[port].awaiting_acks += 1 -} - -initialize_controller := fn(): void { - memory.outb(0x64, 0xAD) - memory.outb(0x64, 0xA7) - //Disables ports to make sure that they won't interfere with the setup process. - - loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) - //Flushes any output because apperantly that might interfere with stuff. - - memory.outb(0x64, 0xA8) - //Enables port 2. - memory.outb(0x64, 0x20) - //Gimme configuration byte. - loop if (memory.inb(0x64) & 1) == 1 break - ports[1].exists = check_bit(memory.inb(0x60), 5, 0) - if ports[1].exists { - memory.outb(0x64, 0xA7) - } - - loop if (memory.inb(0x64) & 1) == 0 break else memory.inb(0x60) - //Flushes any output because apperantly that might interfere with stuff. - - memory.outb(0x64, 0xAB) - loop if (memory.inb(0x64) & 1) == 1 break - ports[0].exists = memory.inb(0x60) == 0x0 - //Test port 1. - - if ports[1].exists { - memory.outb(0x64, 0xA9) - loop if (memory.inb(0x64) & 1) == 1 break - ports[1].exists = memory.inb(0x60) == 0x0 - } - //Test port 2. - - if (ports[0].exists | ports[1].exists) == false { - log.error("No ports detected! No input will be processed! Cannot handle this!\0") - } - - if ports[0].exists { - log.info("Port 1 exists.\0") - memory.outb(0x64, 0xAE) - //Enables port 1. - ports[0].commands_queued = 1 - } - if ports[1].exists { - log.info("Port 2 exists.\0") - memory.outb(0x64, 0xA8) - //Enables port 2. - ports[1].commands_queued = 1 - } -} - -handle_input := fn(port: uint, input: u8): void { - if input == 0xAA { - log.info("Device rebooted!\0") - log.info(string.display_int(@intcast(port + 1), format_page, 16)) - ports[port].state = GetID - send_byte(port, 0xF2) - //Get ID - } else if ports[port].state.value == Recive.value { - } -} - -main := fn(): void { - format_page = memory.alloc(u8, 1024) - - @inline(initialize_controller) - - loop { - port_info := memory.inb(0x64) - - if (port_info & 0x40) > 0 { - log.error("Timeout error! Cannot handle these!\0") - } - if (port_info & 0x80) > 0 { - log.error("Parity error! Cannot handle these!\0") - } - - if (port_info & 1) == 0 { - if ports[0].exists & ports[0].commands_queued > 0 { - memory.outb(0x60, ports[0].command_queue[ports[0].command_index]) - ports[0].commands_queued -= 1 - ports[0].command_index = (ports[0].command_index + 1) % 8 - } - if ports[1].exists & ports[1].commands_queued > 0 { - memory.outb(0x64, 0xD4) - memory.outb(0x60, ports[1].command_queue[ports[1].command_index]) - ports[1].commands_queued -= 1 - ports[1].command_index = (ports[1].command_index + 1) % 8 - } - } - - port := 0 - if ports[1].exists { - port = port_info >> 5 & 1 - } - - if ports[port].exists { - input := memory.inb(0x60) - if ports[port].awaiting_acks > 0 & input == 0xFA { - ports[port].awaiting_acks -= 1 - } else { - @inline(handle_input, port, input) - } - } - } -} \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/port.hb b/sysdata/programs/ps2_driver/src/port.hb index 852d0d6d..108c9aaf 100644 --- a/sysdata/programs/ps2_driver/src/port.hb +++ b/sysdata/programs/ps2_driver/src/port.hb @@ -1,4 +1,4 @@ -.{DeviceID, NoDevice} := @use("devices.hb") +.{DeviceID, NO_DEVICE} := @use("devices.hb") State := struct {s: u8} $Recive := State.(0) @@ -7,13 +7,15 @@ $Reboot := State.(1) Port := packed struct { exists: bool, device: DeviceID, - packet: [u8; 4], + packet: [u8; 8], packet_length: u8, + can_hot_plug: bool, } -$port_at_startup := Port.( +$PORT_AT_STARTUP := Port.( true, - NoDevice, + NO_DEVICE, .(0, 0, 0, 0), 0, + true, ) \ No newline at end of file From 3d5a8f6f10cae005387742f0b2ee4250a176a49a Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 17 Nov 2024 22:38:07 +0100 Subject: [PATCH 19/29] End meeeee --- sysdata/programs/ps2_driver/README.md | 7 ++- sysdata/programs/ps2_driver/src/controller.hb | 6 +- sysdata/programs/ps2_driver/src/main.hb | 61 +++++++++++++++---- sysdata/programs/ps2_driver/src/mouse.hb | 21 +++++++ sysdata/programs/ps2_driver/src/port.hb | 2 +- 5 files changed, 78 insertions(+), 19 deletions(-) create mode 100644 sysdata/programs/ps2_driver/src/mouse.hb diff --git a/sysdata/programs/ps2_driver/README.md b/sysdata/programs/ps2_driver/README.md index 61936064..3f5c5802 100644 --- a/sysdata/programs/ps2_driver/README.md +++ b/sysdata/programs/ps2_driver/README.md @@ -1,6 +1,6 @@ # Unified PS/2 Driver -Te entire thing is heavily documented with comments because I'm not sure how else to make this understandable. +Te entire thing is held together inspite ## !!Assumptions!! Anyone who works on this should work to keep this list as small as possible/remove as many of these as possible. @@ -16,4 +16,7 @@ Anyone who works on this should work to keep this list as small as possible/remo - 0xFFFF - 0x01xx - 0x03xx - - 0x04xx \ No newline at end of file + - 0x04xx +- Literally all PS/2 keyboards can be handeled the exact same way. We have the capability for detecting different keyboard types, I just don't bother with it because that would litreally take months to get working. + +Supporting mice in the keyboard port and vice versa was a ***bad*** idea, but I do not regret it because it means we're "superior" to real world operating systems. \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb index 35fb4fed..029fdd27 100644 --- a/sysdata/programs/ps2_driver/src/controller.hb +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -2,8 +2,8 @@ .{bit0, bit1, bit5, bit6, bit7} := @use("bits.hb"); .{Port, PORT_AT_STARTUP} := @use("port.hb") -port1 := PORT_AT_STARTUP -port2 := PORT_AT_STARTUP +port1 := @as(Port, PORT_AT_STARTUP) +port2 := @as(Port, PORT_AT_STARTUP) $disable_port1 := fn(): void memory.outb(0x64, 0xAD) $enable_port1 := fn(): void memory.outb(0x64, 0xAE) @@ -47,7 +47,7 @@ get_port := fn(info: Info): ^Port { } send_byte := fn(port: ^Port, byte: u8): void { - if port == port2 { + if port == &port2 { memory.outb(0x64, 0xD4) } loop if can_send(get_info()) break diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index 32b786a7..527afc72 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -1,19 +1,51 @@ -.{memory, log, string} := @use("../../../libraries/stn/src/lib.hb") +.{memory, log, buffer, string} := @use("../../../libraries/stn/src/lib.hb"); +.{MouseEvent} := @use("../../../libraries/intouch/src/lib.hb").events; +.{bit0, bit1, bit2, bit3, bit4} := @use("bits.hb") devices := @use("devices.hb") controller := @use("controller.hb") +mouse := @use("mouse.hb") format_page := memory.dangling(u8) +mouse_buffer := 0 +keyboard_buffer := 0 info := controller.Info.(0) -process := fn(port: ^controller.Port): void { - if port.device == devices.MOUSE_3_BUTTON { - } else if port.device == devices.MOUSE_INIT_1 { - port.device.value = port.packet[0] | port.packet[1] << 8 - if port.device == devices.MOUSE_SCROLLWHEEL { - port.device = devices.MOUSE_INIT_2 +send_command := fn(port: ^controller.Port, byte: u8): void { + controller.send_byte(port, byte) + loop { + info = controller.get_info() + if controller.has_input(info) == false { + continue } + input := controller.get_input() + if controller.get_port(info) != port { + if check_complete(port) == false { + } + } + } +} + +process := fn(port: ^controller.Port): void { + if port.device.value < devices.MOUSE_5_BUTTON.value { + event := MouseEvent.(0, 0, false, false, false) + + event.left = bit0(port.packet[0]) + event.right = bit1(port.packet[0]) + event.middle = bit2(port.packet[0]) + + event.x_change = @intcast(port.packet[1]) + event.y_change = @intcast(port.packet[2]) + + buffer.write(MouseEvent, mouse_buffer, &event) + } else if port.device == devices.MOUSE_INIT_1 { + port.device.value = port.packet[0] + if port.device != devices.MOUSE_SCROLLWHEEL { + controller.send_byte(port, 0xF4) + return + } + port.device = devices.MOUSE_INIT_2 } else if port.device == devices.MOUSE_INIT_2 { - port.device.value = port.packet[0] | port.packet[1] << 8 + port.device.value = port.packet[0] } else if port.device == devices.NO_DEVICE { if port.packet_length == 1 { port.device.value = port.packet[0] @@ -33,11 +65,9 @@ check_complete := fn(port: ^controller.Port): bool { } else if port.packet_length == 2 { return true } - } - if port.device == devices.MOUSE_3_BUTTON { + } else if port.device == devices.MOUSE_3_BUTTON { if port.packet_length == 3 return true - } - if port.device == devices.MOUSE_SCROLLWHEEL | port.device == devices.MOUSE_5_BUTTON { + } else if port.device == devices.MOUSE_SCROLLWHEEL | port.device == devices.MOUSE_5_BUTTON { if port.packet_length == 4 return true } else { log.error("Very unexpected error. Cannot handle this!\0") @@ -47,6 +77,7 @@ check_complete := fn(port: ^controller.Port): bool { } main := fn(): void { + mouse_buffer = buffer.create("PS/2 Mouse\0") format_page = memory.alloc(u8, 1024) controller.init() @@ -63,14 +94,18 @@ main := fn(): void { if controller.has_input(info) { port := controller.get_port(info) + if port.packet_length > 0 & check_complete(port) { + process(port) + } input := controller.get_input() if input == 0xAA & port.can_hot_plug { port.device = devices.NO_DEVICE } port.packet[port.packet_length] = input port.packet_length += 1 - if @inline(check_complete, port) { + if check_complete(port) { process(port) + port.packet_length = 0 } } } diff --git a/sysdata/programs/ps2_driver/src/mouse.hb b/sysdata/programs/ps2_driver/src/mouse.hb new file mode 100644 index 00000000..a3dd51b2 --- /dev/null +++ b/sysdata/programs/ps2_driver/src/mouse.hb @@ -0,0 +1,21 @@ +Button := struct {id: u8} +$LEFT_BUTTON := Button.(1) +$RIGHT_BUTTON := Button.(2) +$MIDDLE_BUTTON := Button.(4) +$BUTTON4 := Button.(8) +$BUTTON5 := Button.(16) + +SampleRate := struct {value: u8} +$SR10 := SampleRate.(10) +$SR20 := SampleRate.(20) +$SR40 := SampleRate.(40) +$SR60 := SampleRate.(60) +$SR80 := SampleRate.(80) +$SR100 := SampleRate.(100) +$SR200 := SampleRate.(200) + +Resolution := struct {value: u8} +$RES_1COUNT_PER_MM := Resolution.(0) +$RES_2COUNT_PER_MM := Resolution.(1) +$RES_4COUNT_PER_MM := Resolution.(2) +$RES_8COUNT_PER_MM := Resolution.(3) \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/port.hb b/sysdata/programs/ps2_driver/src/port.hb index 108c9aaf..76563d1b 100644 --- a/sysdata/programs/ps2_driver/src/port.hb +++ b/sysdata/programs/ps2_driver/src/port.hb @@ -15,7 +15,7 @@ Port := packed struct { $PORT_AT_STARTUP := Port.( true, NO_DEVICE, - .(0, 0, 0, 0), + .(0, 0, 0, 0, 0, 0, 0, 0), 0, true, ) \ No newline at end of file From 8f265ebf40415a843c26ac26722aa3987ef050ce Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 17 Nov 2024 22:59:05 +0100 Subject: [PATCH 20/29] PS/2 literally almost work --- sysdata/programs/ps2_driver/README.md | 1 + sysdata/programs/ps2_driver/src/main.hb | 54 +++++++++++++++++++------ 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/sysdata/programs/ps2_driver/README.md b/sysdata/programs/ps2_driver/README.md index 3f5c5802..283b6ae8 100644 --- a/sysdata/programs/ps2_driver/README.md +++ b/sysdata/programs/ps2_driver/README.md @@ -18,5 +18,6 @@ Anyone who works on this should work to keep this list as small as possible/remo - 0x03xx - 0x04xx - Literally all PS/2 keyboards can be handeled the exact same way. We have the capability for detecting different keyboard types, I just don't bother with it because that would litreally take months to get working. +- The device doesn't send any data while we're waiting for an `ACK`. Supporting mice in the keyboard port and vice versa was a ***bad*** idea, but I do not regret it because it means we're "superior" to real world operating systems. \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index 527afc72..a43a3968 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -11,15 +11,25 @@ keyboard_buffer := 0 info := controller.Info.(0) send_command := fn(port: ^controller.Port, byte: u8): void { - controller.send_byte(port, byte) loop { - info = controller.get_info() - if controller.has_input(info) == false { - continue - } - input := controller.get_input() - if controller.get_port(info) != port { - if check_complete(port) == false { + controller.send_byte(port, byte) + loop { + info = controller.get_info() + if controller.has_input(info) == false { + continue + } + input := controller.get_input() + if controller.get_port(info) != port { + if check_complete(port) == false { + port.packet[port.packet_length] = input + port.packet_length += 1 + } + continue + } + if input == 0xFA { + return + } else { + break } } } @@ -51,9 +61,12 @@ process := fn(port: ^controller.Port): void { port.device.value = port.packet[0] } else { port.device.value = port.packet[1] | port.packet[0] << 8 + send_command(port, 0xF4) } log.info("Identified device!\0") log.info(string.display_int(port.device.value, format_page, 16)) + } else { + log.info("KEY PRESSED\0") } } @@ -70,8 +83,17 @@ check_complete := fn(port: ^controller.Port): bool { } else if port.device == devices.MOUSE_SCROLLWHEEL | port.device == devices.MOUSE_5_BUTTON { if port.packet_length == 4 return true } else { - log.error("Very unexpected error. Cannot handle this!\0") - return true + if port.packet[0] == 0xE1 { + if port.packet_length == 6 { + return true + } + } else if port.packet[0] != 0xE0 { + return true + } else if port.packet_length == 2 & port.packet[1] != 0x2A & port.packet[1] != 0xB7 { + return true + } else if port.packet_length == 4 { + return true + } } return false } @@ -82,6 +104,13 @@ main := fn(): void { controller.init() + if controller.port1.exists { + controller.send_byte(&controller.port1, 0xF4) + } + if controller.port2.exists { + controller.send_byte(&controller.port2, 0xF4) + } + loop { info = controller.get_info() @@ -98,9 +127,10 @@ main := fn(): void { process(port) } input := controller.get_input() - if input == 0xAA & port.can_hot_plug { + /*if input == 0xAA & port.can_hot_plug { port.device = devices.NO_DEVICE - } + controller.send_byte(port, 0xF4) + }*/ port.packet[port.packet_length] = input port.packet_length += 1 if check_complete(port) { From d78878a12f4dac7258dbf09959b2175afccdddc1 Mon Sep 17 00:00:00 2001 From: peony Date: Mon, 18 Nov 2024 20:29:51 +0100 Subject: [PATCH 21/29] Compiler error --- sysdata/programs/ps2_driver/error.error | 122 ++++++++++++++++++++++++ sysdata/programs/ps2_driver/src/main.hb | 4 +- 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 sysdata/programs/ps2_driver/error.error diff --git a/sysdata/programs/ps2_driver/error.error b/sysdata/programs/ps2_driver/error.error new file mode 100644 index 00000000..0d74b667 --- /dev/null +++ b/sysdata/programs/ps2_driver/error.error @@ -0,0 +1,122 @@ +2 1 48 Node { kind: Then, inputs: [47], outputs: [90], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 10 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +2 1 88 Node { kind: Region, inputs: [70, 87], outputs: [89, 90], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 18 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +2 1 87 Node { kind: Else, inputs: [69], outputs: [88], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 17 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +2 1 69 Node { kind: If, inputs: [64, 68], outputs: [70, 87], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 16 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +2 1 64 Node { kind: Call { func: Func(18), args: Tuple(193) }, inputs: [63, 5, 39, 40], outputs: [69, 66, 68, 66], peep_triggers: [], clobbers: [0, 1], ty: Id(7), pos: 0, depth: Cell { value: 15 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +2 1 63 Node { kind: Then, inputs: [62], outputs: [64], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 14 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +2 1 70 Node { kind: Then, inputs: [69], outputs: [88, 86, 82, 81, 80, 76, 85, 75, 74, 84, 71, 73], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 17 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +3 1 48 Node { kind: Then, inputs: [47], outputs: [90], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 10 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +3 1 88 Node { kind: Region, inputs: [70, 87], outputs: [89, 90], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 18 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +3 1 87 Node { kind: Else, inputs: [69], outputs: [88], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 17 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +3 1 69 Node { kind: If, inputs: [64, 68], outputs: [70, 87], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 16 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +3 1 64 Node { kind: Call { func: Func(18), args: Tuple(193) }, inputs: [63, 5, 39, 40], outputs: [69, 66, 68, 66], peep_triggers: [], clobbers: [0, 1], ty: Id(7), pos: 0, depth: Cell { value: 15 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +3 1 63 Node { kind: Then, inputs: [62], outputs: [64], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 14 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +3 2 62 Node { kind: If, inputs: [59, 61], outputs: [63, 92], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 13 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 2 }, aclass: 0 } +3 2 59 Node { kind: Call { func: Func(17), args: Tuple(417) }, inputs: [57, 58, 40], outputs: [62, 61, 61], peep_triggers: [82], clobbers: [1], ty: Id(805306369), pos: 0, depth: Cell { value: 12 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 2 }, aclass: 0 } +3 2 57 Node { kind: Call { func: Func(4294967295), args: Tuple(292) }, inputs: [49, 7, 7, 51, 33, 40, 56], outputs: [59, 82, 94, 58], peep_triggers: [], clobbers: [1, 3], ty: Id(8), pos: 0, depth: Cell { value: 11 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 2 }, aclass: 0 } +3 2 49 Node { kind: Else, inputs: [47], outputs: [57], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 10 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 2 }, aclass: 0 } +3 1 70 Node { kind: Then, inputs: [69], outputs: [88, 86, 82, 81, 80, 76, 85, 75, 74, 84, 71, 73], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 17 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } +thread 'main' panicked at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:1761:13: +explicit panic +stack backtrace: + 0: 0x607c994845ba - std::backtrace_rs::backtrace::libunwind::trace::h504b0125eda6b384 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5 + 1: 0x607c994845ba - std::backtrace_rs::backtrace::trace_unsynchronized::hc81f5dfa1a7e52fe + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 + 2: 0x607c994845ba - std::sys::backtrace::_print_fmt::ha179fab1a0be4c59 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/sys/backtrace.rs:66:9 + 3: 0x607c994845ba - ::fmt::hf209b603f512c5df + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/sys/backtrace.rs:39:26 + 4: 0x607c994ae4b3 - core::fmt::rt::Argument::fmt::h04f1d73255100c6c + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/fmt/rt.rs:177:76 + 5: 0x607c994ae4b3 - core::fmt::write::hb7459499d17d36c1 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/fmt/mod.rs:1189:21 + 6: 0x607c99480003 - std::io::Write::write_fmt::h4275802de0932d6f + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/io/mod.rs:1884:15 + 7: 0x607c99484402 - std::sys::backtrace::BacktraceLock::print::hfbfa2f755b02b3d5 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/sys/backtrace.rs:42:9 + 8: 0x607c9948557c - std::panicking::default_hook::{{closure}}::h807768543f95a41b + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:268:22 + 9: 0x607c994853c2 - std::panicking::default_hook::h7a17744703ed785c + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:295:9 + 10: 0x607c99485bb7 - std::panicking::rust_panic_with_hook::h4fba84c8b130fcc8 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:801:13 + 11: 0x607c99485a4a - std::panicking::begin_panic_handler::{{closure}}::h9a05dc892413e069 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:674:13 + 12: 0x607c99484a99 - std::sys::backtrace::__rust_end_short_backtrace::hb562433a6e41eea6 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/sys/backtrace.rs:170:18 + 13: 0x607c994856dc - rust_begin_unwind + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:665:5 + 14: 0x607c994ac660 - core::panicking::panic_fmt::hb2b4d3a454bfbc1d + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/panicking.rs:76:14 + 15: 0x607c994ac7e6 - core::panicking::panic_display::h1590d2675ff6c7bf + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/panicking.rs:269:5 + 16: 0x607c994ac7e6 - core::panicking::panic_explicit::h703879b59c53c7df + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/panicking.rs:240:5 + 17: 0x607c9930378a - hblang::son::Nodes::check_loop_depth_integrity::panic_cold_explicit::h6e60a5356c746729 + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic.rs:88:13 + 18: 0x607c992de896 - hblang::son::Nodes::check_loop_depth_integrity::had2b0c27d2c39985 + at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:1761:13 + 19: 0x607c992fc774 - hblang::son::Codegen::finalize::h13f123c7cd0da7a9 + at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:4730:13 + 20: 0x607c992fc155 - hblang::son::Codegen::emit_func::h15c8dc591b00f53d + at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:4663:12 + 21: 0x607c992fb4f0 - hblang::son::Codegen::complete_call_graph::h8657dc9690902fa0 + at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:4584:13 + 22: 0x607c992e2e76 - hblang::son::Codegen::generate::h1b2054aee9ce9790 + at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:2496:9 + 23: 0x607c993a5ec8 - hblang::fs::run_compiler::h5f6a41b732f9e970 + at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/fs.rs:110:9 + 24: 0x607c98ea4e6d - repbuild::dev::Package::build::hdae17d117d475784 + at /home/b0c1/peo-able/repbuild/src/dev.rs:99:13 + 25: 0x607c98ecb684 - repbuild::get_fs::{{closure}}::h632dfb970319db7a + at /home/b0c1/peo-able/repbuild/src/main.rs:225:27 + 26: 0x607c98ed46c8 - core::iter::adapters::map::map_fold::{{closure}}::ha6a4808f4323eba7 + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:88:28 + 27: 0x607c98e928c8 - core::iter::traits::iterator::Iterator::fold::h1aebe574af7a3edc + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:2546:21 + 28: 0x607c98ed3e6a - as core::iter::traits::iterator::Iterator>::fold::h5f00813cbd913ca4 + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:128:9 + 29: 0x607c98ed4476 - core::iter::traits::iterator::Iterator::for_each::h50c08b7e4fd54442 + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:800:9 + 30: 0x607c98edeec2 - repbuild::get_fs::hf28ffbf58ae795af + at /home/b0c1/peo-able/repbuild/src/main.rs:211:9 + 31: 0x607c98edf79c - repbuild::build::hce2c223cc2728d29 + at /home/b0c1/peo-able/repbuild/src/main.rs:314:14 + 32: 0x607c98edb62a - repbuild::main::hb96a470eed1f6457 + at /home/b0c1/peo-able/repbuild/src/main.rs:71:13 + 33: 0x607c98e8de2b - core::ops::function::FnOnce::call_once::h378a33339d4a24f0 + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5 + 34: 0x607c98ed3ddd - std::sys::backtrace::__rust_begin_short_backtrace::hdd497f77b8d07378 + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:154:18 + 35: 0x607c98ebf9a1 - std::rt::lang_start::{{closure}}::hae9e3782edfc8e36 + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:195:18 + 36: 0x607c99479b47 - core::ops::function::impls:: for &F>::call_once::hebb10914f9a99bfc + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/ops/function.rs:284:13 + 37: 0x607c99479b47 - std::panicking::try::do_call::he587bea39635f003 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:557:40 + 38: 0x607c99479b47 - std::panicking::try::h066d0ac22ca08454 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:520:19 + 39: 0x607c99479b47 - std::panic::catch_unwind::hc9ca199833b3a11d + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panic.rs:358:14 + 40: 0x607c99479b47 - std::rt::lang_start_internal::{{closure}}::hadaa4544f6d8e710 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/rt.rs:174:48 + 41: 0x607c99479b47 - std::panicking::try::do_call::h53342b4fc8ceaf09 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:557:40 + 42: 0x607c99479b47 - std::panicking::try::h51410bd76f769cad + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:520:19 + 43: 0x607c99479b47 - std::panic::catch_unwind::h1b027fc305be26d2 + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panic.rs:358:14 + 44: 0x607c99479b47 - std::rt::lang_start_internal::h4f9aa9060ab8cedd + at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/rt.rs:174:20 + 45: 0x607c98ebf97a - std::rt::lang_start::h0aff8b9ad9d9f551 + at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:194:17 + 46: 0x607c98ee23ae - main + 47: 0x7b317e02a1ca - __libc_start_call_main + at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 + 48: 0x7b317e02a28b - __libc_start_main_impl + at ./csu/../csu/libc-start.c:360:3 + 49: 0x607c98e89025 - _start + 50: 0x0 - +sysdata/programs/ps2_driver/src/main.hb:13:17: panic occured here +send_command := fn(port: ^controller.Port, byte: u8): void { \ No newline at end of file diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index a43a3968..d2289c50 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -11,7 +11,8 @@ keyboard_buffer := 0 info := controller.Info.(0) send_command := fn(port: ^controller.Port, byte: u8): void { - loop { + tries := 3 + loop if tries == 0 break else { controller.send_byte(port, byte) loop { info = controller.get_info() @@ -32,6 +33,7 @@ send_command := fn(port: ^controller.Port, byte: u8): void { break } } + tries -= 1 } } From 96c07e137bdd3cfd7e9d558160695f71189d4eae Mon Sep 17 00:00:00 2001 From: peony Date: Mon, 18 Nov 2024 20:47:46 +0100 Subject: [PATCH 22/29] Removed `error.error` because its in #aos-geeral. --- sysdata/programs/ps2_driver/error.error | 122 ------------------------ 1 file changed, 122 deletions(-) delete mode 100644 sysdata/programs/ps2_driver/error.error diff --git a/sysdata/programs/ps2_driver/error.error b/sysdata/programs/ps2_driver/error.error deleted file mode 100644 index 0d74b667..00000000 --- a/sysdata/programs/ps2_driver/error.error +++ /dev/null @@ -1,122 +0,0 @@ -2 1 48 Node { kind: Then, inputs: [47], outputs: [90], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 10 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -2 1 88 Node { kind: Region, inputs: [70, 87], outputs: [89, 90], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 18 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -2 1 87 Node { kind: Else, inputs: [69], outputs: [88], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 17 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -2 1 69 Node { kind: If, inputs: [64, 68], outputs: [70, 87], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 16 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -2 1 64 Node { kind: Call { func: Func(18), args: Tuple(193) }, inputs: [63, 5, 39, 40], outputs: [69, 66, 68, 66], peep_triggers: [], clobbers: [0, 1], ty: Id(7), pos: 0, depth: Cell { value: 15 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -2 1 63 Node { kind: Then, inputs: [62], outputs: [64], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 14 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -2 1 70 Node { kind: Then, inputs: [69], outputs: [88, 86, 82, 81, 80, 76, 85, 75, 74, 84, 71, 73], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 17 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -3 1 48 Node { kind: Then, inputs: [47], outputs: [90], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 10 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -3 1 88 Node { kind: Region, inputs: [70, 87], outputs: [89, 90], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 18 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -3 1 87 Node { kind: Else, inputs: [69], outputs: [88], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 17 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -3 1 69 Node { kind: If, inputs: [64, 68], outputs: [70, 87], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 16 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -3 1 64 Node { kind: Call { func: Func(18), args: Tuple(193) }, inputs: [63, 5, 39, 40], outputs: [69, 66, 68, 66], peep_triggers: [], clobbers: [0, 1], ty: Id(7), pos: 0, depth: Cell { value: 15 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -3 1 63 Node { kind: Then, inputs: [62], outputs: [64], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 14 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -3 2 62 Node { kind: If, inputs: [59, 61], outputs: [63, 92], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 13 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 2 }, aclass: 0 } -3 2 59 Node { kind: Call { func: Func(17), args: Tuple(417) }, inputs: [57, 58, 40], outputs: [62, 61, 61], peep_triggers: [82], clobbers: [1], ty: Id(805306369), pos: 0, depth: Cell { value: 12 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 2 }, aclass: 0 } -3 2 57 Node { kind: Call { func: Func(4294967295), args: Tuple(292) }, inputs: [49, 7, 7, 51, 33, 40, 56], outputs: [59, 82, 94, 58], peep_triggers: [], clobbers: [1, 3], ty: Id(8), pos: 0, depth: Cell { value: 11 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 2 }, aclass: 0 } -3 2 49 Node { kind: Else, inputs: [47], outputs: [57], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 10 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 2 }, aclass: 0 } -3 1 70 Node { kind: Then, inputs: [69], outputs: [88, 86, 82, 81, 80, 76, 85, 75, 74, 84, 71, 73], peep_triggers: [], clobbers: [], ty: Id(5), pos: 0, depth: Cell { value: 17 }, lock_rc: Cell { value: 0 }, loop_depth: Cell { value: 1 }, aclass: 0 } -thread 'main' panicked at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:1761:13: -explicit panic -stack backtrace: - 0: 0x607c994845ba - std::backtrace_rs::backtrace::libunwind::trace::h504b0125eda6b384 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5 - 1: 0x607c994845ba - std::backtrace_rs::backtrace::trace_unsynchronized::hc81f5dfa1a7e52fe - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 - 2: 0x607c994845ba - std::sys::backtrace::_print_fmt::ha179fab1a0be4c59 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/sys/backtrace.rs:66:9 - 3: 0x607c994845ba - ::fmt::hf209b603f512c5df - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/sys/backtrace.rs:39:26 - 4: 0x607c994ae4b3 - core::fmt::rt::Argument::fmt::h04f1d73255100c6c - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/fmt/rt.rs:177:76 - 5: 0x607c994ae4b3 - core::fmt::write::hb7459499d17d36c1 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/fmt/mod.rs:1189:21 - 6: 0x607c99480003 - std::io::Write::write_fmt::h4275802de0932d6f - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/io/mod.rs:1884:15 - 7: 0x607c99484402 - std::sys::backtrace::BacktraceLock::print::hfbfa2f755b02b3d5 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/sys/backtrace.rs:42:9 - 8: 0x607c9948557c - std::panicking::default_hook::{{closure}}::h807768543f95a41b - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:268:22 - 9: 0x607c994853c2 - std::panicking::default_hook::h7a17744703ed785c - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:295:9 - 10: 0x607c99485bb7 - std::panicking::rust_panic_with_hook::h4fba84c8b130fcc8 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:801:13 - 11: 0x607c99485a4a - std::panicking::begin_panic_handler::{{closure}}::h9a05dc892413e069 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:674:13 - 12: 0x607c99484a99 - std::sys::backtrace::__rust_end_short_backtrace::hb562433a6e41eea6 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/sys/backtrace.rs:170:18 - 13: 0x607c994856dc - rust_begin_unwind - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:665:5 - 14: 0x607c994ac660 - core::panicking::panic_fmt::hb2b4d3a454bfbc1d - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/panicking.rs:76:14 - 15: 0x607c994ac7e6 - core::panicking::panic_display::h1590d2675ff6c7bf - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/panicking.rs:269:5 - 16: 0x607c994ac7e6 - core::panicking::panic_explicit::h703879b59c53c7df - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/panicking.rs:240:5 - 17: 0x607c9930378a - hblang::son::Nodes::check_loop_depth_integrity::panic_cold_explicit::h6e60a5356c746729 - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic.rs:88:13 - 18: 0x607c992de896 - hblang::son::Nodes::check_loop_depth_integrity::had2b0c27d2c39985 - at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:1761:13 - 19: 0x607c992fc774 - hblang::son::Codegen::finalize::h13f123c7cd0da7a9 - at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:4730:13 - 20: 0x607c992fc155 - hblang::son::Codegen::emit_func::h15c8dc591b00f53d - at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:4663:12 - 21: 0x607c992fb4f0 - hblang::son::Codegen::complete_call_graph::h8657dc9690902fa0 - at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:4584:13 - 22: 0x607c992e2e76 - hblang::son::Codegen::generate::h1b2054aee9ce9790 - at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/son.rs:2496:9 - 23: 0x607c993a5ec8 - hblang::fs::run_compiler::h5f6a41b732f9e970 - at /home/b0c1/.cargo/git/checkouts/holey-bytes-7306cae1e59cf4dd/37dd13c/lang/src/fs.rs:110:9 - 24: 0x607c98ea4e6d - repbuild::dev::Package::build::hdae17d117d475784 - at /home/b0c1/peo-able/repbuild/src/dev.rs:99:13 - 25: 0x607c98ecb684 - repbuild::get_fs::{{closure}}::h632dfb970319db7a - at /home/b0c1/peo-able/repbuild/src/main.rs:225:27 - 26: 0x607c98ed46c8 - core::iter::adapters::map::map_fold::{{closure}}::ha6a4808f4323eba7 - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:88:28 - 27: 0x607c98e928c8 - core::iter::traits::iterator::Iterator::fold::h1aebe574af7a3edc - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:2546:21 - 28: 0x607c98ed3e6a - as core::iter::traits::iterator::Iterator>::fold::h5f00813cbd913ca4 - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:128:9 - 29: 0x607c98ed4476 - core::iter::traits::iterator::Iterator::for_each::h50c08b7e4fd54442 - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:800:9 - 30: 0x607c98edeec2 - repbuild::get_fs::hf28ffbf58ae795af - at /home/b0c1/peo-able/repbuild/src/main.rs:211:9 - 31: 0x607c98edf79c - repbuild::build::hce2c223cc2728d29 - at /home/b0c1/peo-able/repbuild/src/main.rs:314:14 - 32: 0x607c98edb62a - repbuild::main::hb96a470eed1f6457 - at /home/b0c1/peo-able/repbuild/src/main.rs:71:13 - 33: 0x607c98e8de2b - core::ops::function::FnOnce::call_once::h378a33339d4a24f0 - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5 - 34: 0x607c98ed3ddd - std::sys::backtrace::__rust_begin_short_backtrace::hdd497f77b8d07378 - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:154:18 - 35: 0x607c98ebf9a1 - std::rt::lang_start::{{closure}}::hae9e3782edfc8e36 - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:195:18 - 36: 0x607c99479b47 - core::ops::function::impls:: for &F>::call_once::hebb10914f9a99bfc - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/core/src/ops/function.rs:284:13 - 37: 0x607c99479b47 - std::panicking::try::do_call::he587bea39635f003 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:557:40 - 38: 0x607c99479b47 - std::panicking::try::h066d0ac22ca08454 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:520:19 - 39: 0x607c99479b47 - std::panic::catch_unwind::hc9ca199833b3a11d - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panic.rs:358:14 - 40: 0x607c99479b47 - std::rt::lang_start_internal::{{closure}}::hadaa4544f6d8e710 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/rt.rs:174:48 - 41: 0x607c99479b47 - std::panicking::try::do_call::h53342b4fc8ceaf09 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:557:40 - 42: 0x607c99479b47 - std::panicking::try::h51410bd76f769cad - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panicking.rs:520:19 - 43: 0x607c99479b47 - std::panic::catch_unwind::h1b027fc305be26d2 - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/panic.rs:358:14 - 44: 0x607c99479b47 - std::rt::lang_start_internal::h4f9aa9060ab8cedd - at /rustc/917a50a03931a9861c19a46f3e2a02a28f1da936/library/std/src/rt.rs:174:20 - 45: 0x607c98ebf97a - std::rt::lang_start::h0aff8b9ad9d9f551 - at /home/b0c1/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:194:17 - 46: 0x607c98ee23ae - main - 47: 0x7b317e02a1ca - __libc_start_call_main - at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 - 48: 0x7b317e02a28b - __libc_start_main_impl - at ./csu/../csu/libc-start.c:360:3 - 49: 0x607c98e89025 - _start - 50: 0x0 - -sysdata/programs/ps2_driver/src/main.hb:13:17: panic occured here -send_command := fn(port: ^controller.Port, byte: u8): void { \ No newline at end of file From f7f9fece4f8ae764b7d9f24d232280b81da2526a Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 24 Nov 2024 13:31:57 +0100 Subject: [PATCH 23/29] Merged once more --- Cargo.lock | 50 ++++++++++++------------- sysdata/programs/ps2_driver/src/main.hb | 26 ++++++++----- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f07974b..838bfd42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,12 +213,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#37dd13cab295aa9e74d704b3345685b4428d149a" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#9dfb2eb606e9049bc5d372e674a75e0be2c57ff0" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#37dd13cab295aa9e74d704b3345685b4428d149a" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#9dfb2eb606e9049bc5d372e674a75e0be2c57ff0" dependencies = [ "hashbrown", "hbbytecode", @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#37dd13cab295aa9e74d704b3345685b4428d149a" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#9dfb2eb606e9049bc5d372e674a75e0be2c57ff0" dependencies = [ "hbbytecode", ] @@ -424,9 +424,9 @@ checksum = "02034f8f6b3e7bf050f310fbaf6db0018b8e54b75598d0a4c97172054752fede" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" @@ -503,9 +503,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -584,9 +584,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.17" +version = "0.23.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" +checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" dependencies = [ "log", "once_cell", @@ -717,9 +717,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.87" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -800,9 +800,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-xid" @@ -833,9 +833,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -876,9 +876,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -1035,9 +1035,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -1047,9 +1047,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", @@ -1059,18 +1059,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", diff --git a/sysdata/programs/ps2_driver/src/main.hb b/sysdata/programs/ps2_driver/src/main.hb index d2289c50..edca6d41 100644 --- a/sysdata/programs/ps2_driver/src/main.hb +++ b/sysdata/programs/ps2_driver/src/main.hb @@ -2,15 +2,16 @@ .{MouseEvent} := @use("../../../libraries/intouch/src/lib.hb").events; .{bit0, bit1, bit2, bit3, bit4} := @use("bits.hb") devices := @use("devices.hb") -controller := @use("controller.hb") +controller := @use("controller.hb"); +.{Info, Port} := controller mouse := @use("mouse.hb") format_page := memory.dangling(u8) mouse_buffer := 0 keyboard_buffer := 0 -info := controller.Info.(0) +info := Info.(0) -send_command := fn(port: ^controller.Port, byte: u8): void { +send_command := fn(port: ^Port, byte: u8): void { tries := 3 loop if tries == 0 break else { controller.send_byte(port, byte) @@ -37,6 +38,10 @@ send_command := fn(port: ^controller.Port, byte: u8): void { } } +enable_streaming := fn(port: ^Port): void { + @inline(send_command, port, 0xF4) +} + process := fn(port: ^controller.Port): void { if port.device.value < devices.MOUSE_5_BUTTON.value { event := MouseEvent.(0, 0, false, false, false) @@ -52,7 +57,7 @@ process := fn(port: ^controller.Port): void { } else if port.device == devices.MOUSE_INIT_1 { port.device.value = port.packet[0] if port.device != devices.MOUSE_SCROLLWHEEL { - controller.send_byte(port, 0xF4) + enable_streaming(port) return } port.device = devices.MOUSE_INIT_2 @@ -61,9 +66,11 @@ process := fn(port: ^controller.Port): void { } else if port.device == devices.NO_DEVICE { if port.packet_length == 1 { port.device.value = port.packet[0] + enable_streaming(port) + //TODO: Upgrade mouse. } else { port.device.value = port.packet[1] | port.packet[0] << 8 - send_command(port, 0xF4) + enable_streaming(port) } log.info("Identified device!\0") log.info(string.display_int(port.device.value, format_page, 16)) @@ -107,10 +114,11 @@ main := fn(): void { controller.init() if controller.port1.exists { - controller.send_byte(&controller.port1, 0xF4) + //log.info("Port 1 exists.\0") + controller.send_byte(@bitcast(0), 0xF4) } if controller.port2.exists { - controller.send_byte(&controller.port2, 0xF4) + //controller.send_byte(&controller.port2, 0xF4) } loop { @@ -122,7 +130,7 @@ main := fn(): void { if controller.check_parity(info) { log.error("Parity error! Cannot handle these!\0") } - + /* if controller.has_input(info) { port := controller.get_port(info) if port.packet_length > 0 & check_complete(port) { @@ -139,6 +147,6 @@ main := fn(): void { process(port) port.packet_length = 0 } - } + }*/ } } \ No newline at end of file From c429641f9864887eb174fd97a86b8a862c0c429a Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 1 Dec 2024 13:10:41 +0100 Subject: [PATCH 24/29] Tiny commit. --- Cargo.lock | 61 ++++++++++--------- sysdata/programs/ps2_driver/src/controller.hb | 32 ++++++---- 2 files changed, 51 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index baaf1a60..372dc7d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,9 +73,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "shlex", ] @@ -201,9 +201,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", @@ -213,12 +213,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#86ca959ea3eae1cb32298e135a444820583d24a0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#86ca959ea3eae1cb32298e135a444820583d24a0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" dependencies = [ "hashbrown", "hbbytecode", @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#86ca959ea3eae1cb32298e135a444820583d24a0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" dependencies = [ "hbbytecode", ] @@ -375,9 +375,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -401,7 +401,7 @@ dependencies = [ "uart_16550", "versioning", "x2apic", - "x86_64 0.15.1", + "x86_64 0.15.2", "xml", ] @@ -421,9 +421,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.164" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "limine" @@ -433,9 +433,9 @@ checksum = "02034f8f6b3e7bf050f310fbaf6db0018b8e54b75598d0a4c97172054752fede" [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] name = "lock_api" @@ -593,9 +593,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.18" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "log", "once_cell", @@ -726,9 +726,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -827,17 +827,20 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" +checksum = "b30e6f97efe1fa43535ee241ee76967d3ff6ff3953ebb430d8d55c5393029e7b" dependencies = [ "base64", + "litemap", "log", "once_cell", "rustls", "rustls-pki-types", "url", "webpki-roots", + "yoke", + "zerofrom", ] [[package]] @@ -996,7 +999,7 @@ dependencies = [ "bitflags 1.3.2", "paste", "raw-cpuid 10.7.0", - "x86_64 0.14.12", + "x86_64 0.14.13", ] [[package]] @@ -1012,9 +1015,9 @@ dependencies = [ [[package]] name = "x86_64" -version = "0.14.12" +version = "0.14.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cb6fd45bfeab6a5055c5bffdb08768bd0c069f1d946debe585bbb380a7c062" +checksum = "c101112411baafbb4bf8d33e4c4a80ab5b02d74d2612331c61e8192fc9710491" dependencies = [ "bit_field", "bitflags 2.6.0", @@ -1024,9 +1027,9 @@ dependencies = [ [[package]] name = "x86_64" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc79523af8abf92fb1a970c3e086c5a343f6bcc1a0eb890f575cbb3b45743df" +checksum = "0f042214de98141e9c8706e8192b73f56494087cc55ebec28ce10f26c5c364ae" dependencies = [ "bit_field", "bitflags 2.6.0", @@ -1044,9 +1047,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.5" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" dependencies = [ "serde", "stable_deref_trait", @@ -1068,9 +1071,9 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" dependencies = [ "zerofrom-derive", ] diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb index 029fdd27..c7767dbe 100644 --- a/sysdata/programs/ps2_driver/src/controller.hb +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -5,34 +5,38 @@ port1 := @as(Port, PORT_AT_STARTUP) port2 := @as(Port, PORT_AT_STARTUP) -$disable_port1 := fn(): void memory.outb(0x64, 0xAD) -$enable_port1 := fn(): void memory.outb(0x64, 0xAE) -$disable_port2 := fn(): void memory.outb(0x64, 0xA7) -$enable_port2 := fn(): void memory.outb(0x64, 0xA8) +//wiki.osdev.org/"8042"_PS/2_Controller#PS/2_Controller_IO_Ports +$CONTROLLER_PORT := 0x64 +$DATA_PORT := 0x60n + +$disable_port1 := fn(): void memory.outb(CONTROLLER_PORT, 0xAD) +$enable_port1 := fn(): void memory.outb(CONTROLLER_PORT, 0xAE) +$disable_port2 := fn(): void memory.outb(CONTROLLER_PORT, 0xA7) +$enable_port2 := fn(): void memory.outb(CONTROLLER_PORT, 0xA8) test_port1 := fn(): bool { - memory.outb(0x64, 0xAB) + memory.outb(CONTROLLER_PORT, 0xAB) loop if has_input(get_info()) break input := get_input() return input == 0x0 } test_port2 := fn(): bool { - memory.outb(0x64, 0xA9) + memory.outb(CONTROLLER_PORT, 0xA9) loop if has_input(get_info()) break input := get_input() return input == 0x0 } get_config_byte := fn(): u8 { - memory.outb(0x64, 0x20) + memory.outb(CONTROLLER_PORT, 0x20) loop if has_input(get_info()) break return get_input() } Info := struct {d: u8} -$get_info := fn(): Info return .(memory.inb(0x64)) +$get_info := fn(): Info return .(memory.inb(CONTROLLER_PORT)) //inline when can has_input := fn(info: Info): bool return bit0(info.d) can_send := fn(info: Info): bool return bit1(info.d) == false @@ -46,16 +50,18 @@ get_port := fn(info: Info): ^Port { } } +//T +port2_ptr := &port2 send_byte := fn(port: ^Port, byte: u8): void { - if port == &port2 { - memory.outb(0x64, 0xD4) + if port == port2_ptr { + memory.outb(CONTROLLER_PORT, 0xD4) } loop if can_send(get_info()) break - memory.outb(0x60, byte) + memory.outb(DATA_PORT, byte) } -$get_input := fn(): u8 return memory.inb(0x60) -$write_out := fn(data: u8): void memory.outb(0x60, data) +$get_input := fn(): u8 return memory.inb(DATA_PORT) +$write_out := fn(data: u8): void memory.outb(DATA_PORT, data) flush_input := fn(): void { loop if has_input(get_info()) == false break else get_info() From b3d07b52351428387497a91d17ebddb5321445b0 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 1 Dec 2024 13:13:13 +0100 Subject: [PATCH 25/29] Uhm, I dunno how that got there. --- sysdata/programs/ps2_driver/src/controller.hb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdata/programs/ps2_driver/src/controller.hb b/sysdata/programs/ps2_driver/src/controller.hb index c7767dbe..497b4607 100644 --- a/sysdata/programs/ps2_driver/src/controller.hb +++ b/sysdata/programs/ps2_driver/src/controller.hb @@ -7,7 +7,7 @@ port2 := @as(Port, PORT_AT_STARTUP) //wiki.osdev.org/"8042"_PS/2_Controller#PS/2_Controller_IO_Ports $CONTROLLER_PORT := 0x64 -$DATA_PORT := 0x60n +$DATA_PORT := 0x60 $disable_port1 := fn(): void memory.outb(CONTROLLER_PORT, 0xAD) $enable_port1 := fn(): void memory.outb(CONTROLLER_PORT, 0xAE) From e3abec2927bd61a2faa4c01bcf2244c1011128e4 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 1 Dec 2024 13:36:12 +0100 Subject: [PATCH 26/29] Errorrr --- sysdata/programs/ps2_driver/error.:3 | 99 ++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sysdata/programs/ps2_driver/error.:3 diff --git a/sysdata/programs/ps2_driver/error.:3 b/sysdata/programs/ps2_driver/error.:3 new file mode 100644 index 00000000..4c16a448 --- /dev/null +++ b/sysdata/programs/ps2_driver/error.:3 @@ -0,0 +1,99 @@ + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s + Running `target/debug/repbuild r -r -d --noaccel` + Compiling x86_64 v0.14.13 + Compiling crossbeam-queue v0.3.11 + Compiling uart_16550 v0.3.2 + Compiling derive_more v1.0.0 + Compiling spin v0.9.8 + Compiling hbvm v0.1.0 (https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb) +error[E0053]: method `steps_between` has an incompatible type for trait + --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.14.13/src/addr.rs:387:51 + | +387 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { + | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` + | + = note: expected signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> Option` + found signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> (usize, Option)` +help: change the output type to match the trait + | +387 | fn steps_between(start: &Self, end: &Self) -> Option { + | ~~~~~~~~~~~~~ + + Compiling slab v0.4.9 +error[E0053]: method `steps_between` has an incompatible type for trait + --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.14.13/src/structures/paging/page.rs:284:51 + | +284 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { + | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` + | + = note: expected signature `fn(&Page<_>, &Page<_>) -> Option` + found signature `fn(&Page<_>, &Page<_>) -> (usize, Option)` +help: change the output type to match the trait + | +284 | fn steps_between(start: &Self, end: &Self) -> Option { + | ~~~~~~~~~~~~~ + + Compiling xml v0.1.0 (https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2) + Compiling versioning v0.1.3 (https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2) + Compiling x86_64 v0.15.2 + Compiling ktest_macro v0.1.0 (/home/meOwO/peo-able/kernel/ktest_macro) + Compiling limine v0.1.12 + Compiling log v0.4.22 +error[E0053]: method `steps_between` has an incompatible type for trait + --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.2/src/addr.rs:406:51 + | +406 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { + | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` + | + = note: expected signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> Option` + found signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> (usize, Option)` +help: change the output type to match the trait + | +406 | fn steps_between(start: &Self, end: &Self) -> Option { + | ~~~~~~~~~~~~~ + +For more information about this error, try `rustc --explain E0053`. +error: could not compile `x86_64` (lib) due to 2 previous errors +warning: build failed, waiting for other jobs to finish... +error[E0053]: method `steps_between` has an incompatible type for trait + --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.2/src/structures/paging/page.rs:307:51 + | +307 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { + | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` + | + = note: expected signature `fn(&page::Page<_>, &page::Page<_>) -> Option` + found signature `fn(&page::Page<_>, &page::Page<_>) -> (usize, Option)` +help: change the output type to match the trait + | +307 | fn steps_between(start: &Self, end: &Self) -> Option { + | ~~~~~~~~~~~~~ + +error[E0053]: method `steps_between` has an incompatible type for trait + --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.2/src/structures/paging/page_table.rs:356:51 + | +356 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { + | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` + | + = note: expected signature `fn(&PageTableIndex, &PageTableIndex) -> Option` + found signature `fn(&PageTableIndex, &PageTableIndex) -> (usize, Option)` +help: change the output type to match the trait + | +356 | fn steps_between(start: &Self, end: &Self) -> Option { + | ~~~~~~~~~~~~~ + +error[E0308]: mismatched types + --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.2/src/structures/paging/page_table.rs:357:9 + | +356 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { + | ---------------------- expected `(usize, Option)` because of return type +357 | Step::steps_between(&start.0, &end.0) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(usize, Option)`, found `Option` + | + = note: expected tuple `(usize, Option)` + found enum `Option` + +Some errors have detailed explanations: E0053, E0308. +For more information about an error, try `rustc --explain E0053`. +error: could not compile `x86_64` (lib) due to 4 previous errors +Error: Failed to build the kernel +╰╴at repbuild/src/main.rs:369:41 \ No newline at end of file From 498cfbf913ed3b2d03b02c30d5fe8003cac584d8 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 1 Dec 2024 13:39:40 +0100 Subject: [PATCH 27/29] Removed error dump. --- sysdata/programs/ps2_driver/error.:3 | 99 ---------------------------- 1 file changed, 99 deletions(-) delete mode 100644 sysdata/programs/ps2_driver/error.:3 diff --git a/sysdata/programs/ps2_driver/error.:3 b/sysdata/programs/ps2_driver/error.:3 deleted file mode 100644 index 4c16a448..00000000 --- a/sysdata/programs/ps2_driver/error.:3 +++ /dev/null @@ -1,99 +0,0 @@ - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s - Running `target/debug/repbuild r -r -d --noaccel` - Compiling x86_64 v0.14.13 - Compiling crossbeam-queue v0.3.11 - Compiling uart_16550 v0.3.2 - Compiling derive_more v1.0.0 - Compiling spin v0.9.8 - Compiling hbvm v0.1.0 (https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb) -error[E0053]: method `steps_between` has an incompatible type for trait - --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.14.13/src/addr.rs:387:51 - | -387 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { - | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` - | - = note: expected signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> Option` - found signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> (usize, Option)` -help: change the output type to match the trait - | -387 | fn steps_between(start: &Self, end: &Self) -> Option { - | ~~~~~~~~~~~~~ - - Compiling slab v0.4.9 -error[E0053]: method `steps_between` has an incompatible type for trait - --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.14.13/src/structures/paging/page.rs:284:51 - | -284 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { - | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` - | - = note: expected signature `fn(&Page<_>, &Page<_>) -> Option` - found signature `fn(&Page<_>, &Page<_>) -> (usize, Option)` -help: change the output type to match the trait - | -284 | fn steps_between(start: &Self, end: &Self) -> Option { - | ~~~~~~~~~~~~~ - - Compiling xml v0.1.0 (https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2) - Compiling versioning v0.1.3 (https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2) - Compiling x86_64 v0.15.2 - Compiling ktest_macro v0.1.0 (/home/meOwO/peo-able/kernel/ktest_macro) - Compiling limine v0.1.12 - Compiling log v0.4.22 -error[E0053]: method `steps_between` has an incompatible type for trait - --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.2/src/addr.rs:406:51 - | -406 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { - | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` - | - = note: expected signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> Option` - found signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> (usize, Option)` -help: change the output type to match the trait - | -406 | fn steps_between(start: &Self, end: &Self) -> Option { - | ~~~~~~~~~~~~~ - -For more information about this error, try `rustc --explain E0053`. -error: could not compile `x86_64` (lib) due to 2 previous errors -warning: build failed, waiting for other jobs to finish... -error[E0053]: method `steps_between` has an incompatible type for trait - --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.2/src/structures/paging/page.rs:307:51 - | -307 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { - | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` - | - = note: expected signature `fn(&page::Page<_>, &page::Page<_>) -> Option` - found signature `fn(&page::Page<_>, &page::Page<_>) -> (usize, Option)` -help: change the output type to match the trait - | -307 | fn steps_between(start: &Self, end: &Self) -> Option { - | ~~~~~~~~~~~~~ - -error[E0053]: method `steps_between` has an incompatible type for trait - --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.2/src/structures/paging/page_table.rs:356:51 - | -356 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { - | ^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `(usize, Option)` - | - = note: expected signature `fn(&PageTableIndex, &PageTableIndex) -> Option` - found signature `fn(&PageTableIndex, &PageTableIndex) -> (usize, Option)` -help: change the output type to match the trait - | -356 | fn steps_between(start: &Self, end: &Self) -> Option { - | ~~~~~~~~~~~~~ - -error[E0308]: mismatched types - --> /home/meOwO/.cargo/registry/src/index.crates.io-6f17d22bba15001f/x86_64-0.15.2/src/structures/paging/page_table.rs:357:9 - | -356 | fn steps_between(start: &Self, end: &Self) -> (usize, Option) { - | ---------------------- expected `(usize, Option)` because of return type -357 | Step::steps_between(&start.0, &end.0) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(usize, Option)`, found `Option` - | - = note: expected tuple `(usize, Option)` - found enum `Option` - -Some errors have detailed explanations: E0053, E0308. -For more information about an error, try `rustc --explain E0053`. -error: could not compile `x86_64` (lib) due to 4 previous errors -Error: Failed to build the kernel -╰╴at repbuild/src/main.rs:369:41 \ No newline at end of file From 821497fbe60590a31d0ee28acb10a4113f2c4fce Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 1 Dec 2024 13:52:12 +0100 Subject: [PATCH 28/29] Deleted Cargo.lock --- Cargo.lock | 1119 ---------------------------------------------------- todo.md | 40 -- 2 files changed, 1159 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 todo.md diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 372dc7d3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1119 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "aarch64-cpu" -version = "9.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac42a04a61c19fc8196dd728022a784baecc5d63d7e256c01ad1b3fbfab26287" -dependencies = [ - "tock-registers", -] - -[[package]] -name = "allocator-api2" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" - -[[package]] -name = "anyhow" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" - -[[package]] -name = "bit" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b645c5c09a7d4035949cfce1a915785aaad6f17800c35fda8a8c311c491f284" - -[[package]] -name = "bit_field" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cc" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" -dependencies = [ - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "derive_more" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "dev" -version = "0.1.0" -dependencies = [ - "logos", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "error-stack" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe413319145d1063f080f27556fd30b1d70b01e2ba10c2a6e40d4be982ffc5d1" -dependencies = [ - "anyhow", - "rustc_version", -] - -[[package]] -name = "fatfs" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05669f8e7e2d7badc545c513710f0eba09c2fbef683eb859fd79c46c355048e0" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "log", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foldhash" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] - -[[package]] -name = "hbbytecode" -version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" - -[[package]] -name = "hblang" -version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" -dependencies = [ - "hashbrown", - "hbbytecode", - "hbvm", - "log", -] - -[[package]] -name = "hbvm" -version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" -dependencies = [ - "hbbytecode", -] - -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "idna" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indexmap" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "kernel" -version = "0.2.0" -dependencies = [ - "aarch64-cpu", - "crossbeam-queue", - "derive_more", - "hashbrown", - "hbvm", - "ktest_macro", - "limine", - "log", - "sbi", - "slab", - "spin", - "uart_16550", - "versioning", - "x2apic", - "x86_64 0.15.2", - "xml", -] - -[[package]] -name = "ktest_macro" -version = "0.1.0" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.167" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" - -[[package]] -name = "limine" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02034f8f6b3e7bf050f310fbaf6db0018b8e54b75598d0a4c97172054752fede" - -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "logos" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6b6e02facda28ca5fb8dbe4b152496ba3b1bd5a4b40bb2b1b2d8ad74e0f39b" -dependencies = [ - "logos-derive", -] - -[[package]] -name = "logos-codegen" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32eb6b5f26efacd015b000bfc562186472cd9b34bdba3f6b264e2a052676d10" -dependencies = [ - "beef", - "fnv", - "lazy_static", - "proc-macro2", - "quote", - "regex-syntax", - "syn", -] - -[[package]] -name = "logos-derive" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5d0c5463c911ef55624739fc353238b4e310f0144be1f875dc42fec6bfd5ec" -dependencies = [ - "logos-codegen", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "proc-macro2" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "raw-cpuid" -version = "10.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "raw-cpuid" -version = "11.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "repbuild" -version = "0.2.0" -dependencies = [ - "derive_more", - "error-stack", - "fatfs", - "hblang", - "log", - "raw-cpuid 11.2.0", - "str-reader", - "toml", - "ureq", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustls" -version = "0.23.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" -dependencies = [ - "log", - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pki-types" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" - -[[package]] -name = "rustls-webpki" -version = "0.102.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" - -[[package]] -name = "sbi" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29cb0870400aca7e4487e8ec1e93f9d4288da763cb1da2cedc5102e62b6522ad" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.215" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.215" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "str-reader" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6aa20b89aec46e0bffbb8756e089beb4c43bbec53d0667de34212f048bdab10" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "2.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tock-registers" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "696941a0aee7e276a165a978b37918fd5d22c55c3d6bda197813070ca9c0f21c" - -[[package]] -name = "toml" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "uart_16550" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e492212ac378a5e00da953718dafb1340d9fbaf4f27d6f3c5cab03d931d1c049" -dependencies = [ - "bitflags 2.6.0", - "rustversion", - "x86", -] - -[[package]] -name = "unicode-ident" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "ureq" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30e6f97efe1fa43535ee241ee76967d3ff6ff3953ebb430d8d55c5393029e7b" -dependencies = [ - "base64", - "litemap", - "log", - "once_cell", - "rustls", - "rustls-pki-types", - "url", - "webpki-roots", - "yoke", - "zerofrom", -] - -[[package]] -name = "url" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "versioning" -version = "0.1.3" -source = "git+https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2f1f7f04b43a8def709de1da98cb5fba1" -dependencies = [ - "serde", -] - -[[package]] -name = "volatile" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442887c63f2c839b346c192d047a7c87e73d0689c9157b00b53dcc27dd5ea793" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "webpki-roots" -version = "0.26.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" -dependencies = [ - "memchr", -] - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "x2apic" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbcd582541cbb8ef1dfc24a3c849a64ff074b1b512af723ad90056558d424602" -dependencies = [ - "bit", - "bitflags 1.3.2", - "paste", - "raw-cpuid 10.7.0", - "x86_64 0.14.13", -] - -[[package]] -name = "x86" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2781db97787217ad2a2845c396a5efe286f87467a5810836db6d74926e94a385" -dependencies = [ - "bit_field", - "bitflags 1.3.2", - "raw-cpuid 10.7.0", -] - -[[package]] -name = "x86_64" -version = "0.14.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c101112411baafbb4bf8d33e4c4a80ab5b02d74d2612331c61e8192fc9710491" -dependencies = [ - "bit_field", - "bitflags 2.6.0", - "rustversion", - "volatile", -] - -[[package]] -name = "x86_64" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f042214de98141e9c8706e8192b73f56494087cc55ebec28ce10f26c5c364ae" -dependencies = [ - "bit_field", - "bitflags 2.6.0", - "rustversion", - "volatile", -] - -[[package]] -name = "xml" -version = "0.1.0" -source = "git+https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2f1f7f04b43a8def709de1da98cb5fba1" -dependencies = [ - "serde", -] - -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/todo.md b/todo.md deleted file mode 100644 index b29d2231..00000000 --- a/todo.md +++ /dev/null @@ -1,40 +0,0 @@ -@konii - Windowing System - Rendering - -@able - Windowing System - Interrupt Forwarding - - -@peony - PS/2 - XYZ - - -@kodin - AIDL AbleOS Interface Description Language - UI-SEXPR lispy ui decl language - -@morshy - Simple Userland Allocator - -@funky - Kernel Testing Framework (A rust framework for testing the kernel) - -@unassigned - FileIO (Fat32) - DiskIO (Undecided Disk type) - Proper Memory Protection - Channels (Two buffers bundled together to form two way communication) - Userland Testing Framework (An hblang framework for testing the userspace) - PCI/E (Honestly I have no fucking clue whats going on with PCI or why userland cant properly read it) - Kernel Reimpl (Do not you dare think about this yet its only here as an option to show goals) - - AbleOS Compiler Collection - acc-asm - hblang^2 (hblang compiler in hblang) - - - - From 13c4649fd6a7a6ecc9ab9a650d51de1d33104828 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 1 Dec 2024 13:53:45 +0100 Subject: [PATCH 29/29] /shrug --- Cargo.lock | 1119 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1119 insertions(+) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..372dc7d3 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1119 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aarch64-cpu" +version = "9.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac42a04a61c19fc8196dd728022a784baecc5d63d7e256c01ad1b3fbfab26287" +dependencies = [ + "tock-registers", +] + +[[package]] +name = "allocator-api2" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" + +[[package]] +name = "anyhow" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "bit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b645c5c09a7d4035949cfce1a915785aaad6f17800c35fda8a8c311c491f284" + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "dev" +version = "0.1.0" +dependencies = [ + "logos", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "error-stack" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe413319145d1063f080f27556fd30b1d70b01e2ba10c2a6e40d4be982ffc5d1" +dependencies = [ + "anyhow", + "rustc_version", +] + +[[package]] +name = "fatfs" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05669f8e7e2d7badc545c513710f0eba09c2fbef683eb859fd79c46c355048e0" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "log", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hbbytecode" +version = "0.1.0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" + +[[package]] +name = "hblang" +version = "0.1.0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" +dependencies = [ + "hashbrown", + "hbbytecode", + "hbvm", + "log", +] + +[[package]] +name = "hbvm" +version = "0.1.0" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#cf672beb79378fa2af529e12fd955204da443ac8" +dependencies = [ + "hbbytecode", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "kernel" +version = "0.2.0" +dependencies = [ + "aarch64-cpu", + "crossbeam-queue", + "derive_more", + "hashbrown", + "hbvm", + "ktest_macro", + "limine", + "log", + "sbi", + "slab", + "spin", + "uart_16550", + "versioning", + "x2apic", + "x86_64 0.15.2", + "xml", +] + +[[package]] +name = "ktest_macro" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.167" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" + +[[package]] +name = "limine" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02034f8f6b3e7bf050f310fbaf6db0018b8e54b75598d0a4c97172054752fede" + +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "logos" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6b6e02facda28ca5fb8dbe4b152496ba3b1bd5a4b40bb2b1b2d8ad74e0f39b" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32eb6b5f26efacd015b000bfc562186472cd9b34bdba3f6b264e2a052676d10" +dependencies = [ + "beef", + "fnv", + "lazy_static", + "proc-macro2", + "quote", + "regex-syntax", + "syn", +] + +[[package]] +name = "logos-derive" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5d0c5463c911ef55624739fc353238b4e310f0144be1f875dc42fec6bfd5ec" +dependencies = [ + "logos-codegen", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "raw-cpuid" +version = "10.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "raw-cpuid" +version = "11.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "repbuild" +version = "0.2.0" +dependencies = [ + "derive_more", + "error-stack", + "fatfs", + "hblang", + "log", + "raw-cpuid 11.2.0", + "str-reader", + "toml", + "ureq", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.23.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" + +[[package]] +name = "sbi" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29cb0870400aca7e4487e8ec1e93f9d4288da763cb1da2cedc5102e62b6522ad" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "str-reader" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6aa20b89aec46e0bffbb8756e089beb4c43bbec53d0667de34212f048bdab10" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tock-registers" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "696941a0aee7e276a165a978b37918fd5d22c55c3d6bda197813070ca9c0f21c" + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "uart_16550" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e492212ac378a5e00da953718dafb1340d9fbaf4f27d6f3c5cab03d931d1c049" +dependencies = [ + "bitflags 2.6.0", + "rustversion", + "x86", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30e6f97efe1fa43535ee241ee76967d3ff6ff3953ebb430d8d55c5393029e7b" +dependencies = [ + "base64", + "litemap", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", + "yoke", + "zerofrom", +] + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "versioning" +version = "0.1.3" +source = "git+https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2f1f7f04b43a8def709de1da98cb5fba1" +dependencies = [ + "serde", +] + +[[package]] +name = "volatile" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442887c63f2c839b346c192d047a7c87e73d0689c9157b00b53dcc27dd5ea793" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "webpki-roots" +version = "0.26.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "x2apic" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbcd582541cbb8ef1dfc24a3c849a64ff074b1b512af723ad90056558d424602" +dependencies = [ + "bit", + "bitflags 1.3.2", + "paste", + "raw-cpuid 10.7.0", + "x86_64 0.14.13", +] + +[[package]] +name = "x86" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2781db97787217ad2a2845c396a5efe286f87467a5810836db6d74926e94a385" +dependencies = [ + "bit_field", + "bitflags 1.3.2", + "raw-cpuid 10.7.0", +] + +[[package]] +name = "x86_64" +version = "0.14.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c101112411baafbb4bf8d33e4c4a80ab5b02d74d2612331c61e8192fc9710491" +dependencies = [ + "bit_field", + "bitflags 2.6.0", + "rustversion", + "volatile", +] + +[[package]] +name = "x86_64" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f042214de98141e9c8706e8192b73f56494087cc55ebec28ce10f26c5c364ae" +dependencies = [ + "bit_field", + "bitflags 2.6.0", + "rustversion", + "volatile", +] + +[[package]] +name = "xml" +version = "0.1.0" +source = "git+https://git.ablecorp.us/ableos/ableos_userland#6c38f2b2f1f7f04b43a8def709de1da98cb5fba1" +dependencies = [ + "serde", +] + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +]