summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2018-09-24 23:23:19 +0200
committerDaniel Weipert <code@drogueronin.de>2018-09-24 23:23:19 +0200
commit87293b0a1150b1bc7467f6916419f56f9f2be075 (patch)
treec254231193037001f6875286d80b13250e47b9f7 /src
Initial commit
Diffstat (limited to 'src')
-rw-r--r--src/main.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..0d36800
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,29 @@
+#![no_std]
+#![no_main]
+
+extern crate bootloader_precompiled;
+
+use core::panic::PanicInfo;
+
+/// This function is called on panic.
+#[panic_handler]
+#[no_mangle]
+pub fn panic(_info: &PanicInfo) -> ! {
+ loop {}
+}
+
+static TEXT: &[u8] = b"Hello Marius! I do cool operating system development stuff look at meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee!";
+
+#[no_mangle]
+pub extern "C" fn _start() -> ! {
+ let vga_buffer = 0xb8000 as *mut u8;
+
+ for (i, &byte) in TEXT.iter().enumerate() {
+ unsafe {
+ *vga_buffer.offset(i as isize * 2) = byte;
+ *vga_buffer.offset(i as isize * 2 + 1) = 0x6;
+ }
+ }
+
+ loop {}
+}