diff --git a/repbuild/src/main.rs b/repbuild/src/main.rs index f9c069166..e2cc634d8 100644 --- a/repbuild/src/main.rs +++ b/repbuild/src/main.rs @@ -149,6 +149,7 @@ fn get_fs() -> Result, io::Error> { "target/test-programs/failure.hbf", "target/test-programs/ecall.hbf", "target/test-programs/main.hbf", + "target/test-programs/serial_driver.hbf", "target/test-programs/vfs_test.hbf", "target/test-programs/limine_framebuffer_driver.hbf", ] { diff --git a/sysdata/limine.cfg b/sysdata/limine.cfg index 8e5699f69..c082f6859 100644 --- a/sysdata/limine.cfg +++ b/sysdata/limine.cfg @@ -31,4 +31,7 @@ TERM_BACKDROP=008080 MODULE_CMDLINE="" MODULE_PATH=boot:///limine_framebuffer_driver.hbf - MODULE_CMDLINE="height=10 width=10 arch=${ARCH}" \ No newline at end of file + MODULE_CMDLINE="height=10 width=10 arch=${ARCH}" + + MODULE_PATH=boot:///serial_driver.hbf + MODULE_CMDLINE="arch=${ARCH}" \ No newline at end of file diff --git a/sysdata/test-programs/limine_framebuffer_driver.rhai b/sysdata/test-programs/limine_framebuffer_driver.rhai index bfd3969e3..7b1a6f57b 100644 --- a/sysdata/test-programs/limine_framebuffer_driver.rhai +++ b/sysdata/test-programs/limine_framebuffer_driver.rhai @@ -90,6 +90,14 @@ fn main(){ li64(r2, 1); eca(); + // Zero out all used registers + li64(r1, 0); + li64(r2, 0); + li64(r3, 0); + li64(r4, 0); + li64(r5, 0); + li64(r6, 0); + li64(r7, 0); } std::Info("Starting the limine framebuffer driver."); // un(); diff --git a/sysdata/test-programs/serial_driver.rhai b/sysdata/test-programs/serial_driver.rhai new file mode 100644 index 000000000..546b5a54e --- /dev/null +++ b/sysdata/test-programs/serial_driver.rhai @@ -0,0 +1,27 @@ +import "sysdata/test-programs/hblib/std" as std; + + + +fn main(){ + let ADDR = 0; + // FIXME: Actually check the arch argument + let architecture = "ARM"; + if architecture == "ARM" { + std::Info("Arm Serial Driver"); + ADDR = 0x09000000; + } + + + lra(r3, r0, ADDR); + + li64(r1, 0); + li8(r1, 65); + st(r1, r0, ADDR, 1); + + // New Line + li8(r1, 12);st(r1, r0, ADDR, 1); + + tx(); +} + +main(); \ No newline at end of file