summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs20
-rw-r--r--src/linker.ld8
2 files changed, 28 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..c6cb39e
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,20 @@
+#![no_std]
+#![no_main]
+
+use core::panic::PanicInfo;
+
+#[unsafe(no_mangle)]
+pub extern "C" fn _start() -> ! {
+ // 'k'
+ loop{unsafe {core::arch::asm!(
+ "out dx, al", in("al") 0x6Bu8
+ )}}
+}
+
+#[panic_handler]
+fn panic(_: &PanicInfo) -> ! {
+ // 'p'
+ loop{unsafe {core::arch::asm!(
+ "out dx, al", in("al") 0x70u8
+ )}}
+}
diff --git a/src/linker.ld b/src/linker.ld
new file mode 100644
index 0000000..b523bc5
--- /dev/null
+++ b/src/linker.ld
@@ -0,0 +1,8 @@
+SECTIONS
+{
+ . = 0x00010000;
+ .text : {
+ *(.text._start)
+ *(.text*)
+ }
+}