1
0
Fork 0
forked from koniifer/ableos

POC serial driver for arm

Does not work for x86 yet
This commit is contained in:
able 2023-11-21 03:56:18 -06:00
parent 562fb7c9b2
commit 65b6f52d2e
4 changed files with 40 additions and 1 deletions

View file

@ -149,6 +149,7 @@ fn get_fs() -> Result<FileSystem<impl ReadWriteSeek>, io::Error> {
"target/test-programs/failure.hbf", "target/test-programs/failure.hbf",
"target/test-programs/ecall.hbf", "target/test-programs/ecall.hbf",
"target/test-programs/main.hbf", "target/test-programs/main.hbf",
"target/test-programs/serial_driver.hbf",
"target/test-programs/vfs_test.hbf", "target/test-programs/vfs_test.hbf",
"target/test-programs/limine_framebuffer_driver.hbf", "target/test-programs/limine_framebuffer_driver.hbf",
] { ] {

View file

@ -31,4 +31,7 @@ TERM_BACKDROP=008080
MODULE_CMDLINE="" MODULE_CMDLINE=""
MODULE_PATH=boot:///limine_framebuffer_driver.hbf MODULE_PATH=boot:///limine_framebuffer_driver.hbf
MODULE_CMDLINE="height=10 width=10 arch=${ARCH}" MODULE_CMDLINE="height=10 width=10 arch=${ARCH}"
MODULE_PATH=boot:///serial_driver.hbf
MODULE_CMDLINE="arch=${ARCH}"

View file

@ -90,6 +90,14 @@ fn main(){
li64(r2, 1); li64(r2, 1);
eca(); 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."); std::Info("Starting the limine framebuffer driver.");
// un(); // un();

View file

@ -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();