POC serial driver for arm
Does not work for x86 yet
This commit is contained in:
parent
562fb7c9b2
commit
65b6f52d2e
|
@ -149,6 +149,7 @@ fn get_fs() -> Result<FileSystem<impl ReadWriteSeek>, 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",
|
||||
] {
|
||||
|
|
|
@ -31,4 +31,7 @@ TERM_BACKDROP=008080
|
|||
MODULE_CMDLINE=""
|
||||
|
||||
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}"
|
|
@ -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();
|
||||
|
|
27
sysdata/test-programs/serial_driver.rhai
Normal file
27
sysdata/test-programs/serial_driver.rhai
Normal 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();
|
Loading…
Reference in a new issue