Compare commits
5 Commits
e9705f7579
...
872e6f3392
Author | SHA1 | Date |
---|---|---|
|
872e6f3392 | |
|
c2af2eee97 | |
|
559d00e872 | |
|
91b52f1872 | |
|
a164d9d67c |
|
@ -0,0 +1 @@
|
||||||
|
BasedOnStyle: Google
|
|
@ -1 +1,2 @@
|
||||||
builddbg/
|
builddbg/
|
||||||
|
compile_commands.json
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
add_executable(zion
|
add_executable(zion
|
||||||
|
debug/debug.cpp
|
||||||
zion.cpp)
|
zion.cpp)
|
||||||
|
|
||||||
|
target_include_directories(zion
|
||||||
|
PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
# -c -- Don't run the linker.
|
# -c -- Don't run the linker.
|
||||||
# -nostdlib -- Don't include the standard library.
|
# -nostdlib -- Don't include the standard library.
|
||||||
# -mabi=sysv -- Explicitly specify the ABI since we will rely on it.
|
# -mabi=sysv -- Explicitly specify the ABI since we will rely on it.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Needs to be copied into the EFI partition of the drive.
|
# Needs to be copied into the EFI partition of the drive.
|
||||||
|
|
||||||
TIMEOUT=10
|
TIMEOUT=0
|
||||||
|
|
||||||
:AcadiaOS
|
:AcadiaOS
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
static inline uint8_t inb(uint16_t port) {
|
||||||
|
uint8_t result;
|
||||||
|
asm volatile("inb %1, %0" : "=a"(result) : "Nd"(port));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void outb(uint16_t port, uint8_t value) {
|
||||||
|
asm volatile("outb %0, %1" ::"a"(value), "Nd"(port));
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include "debug/debug.h"
|
||||||
|
|
||||||
|
#include "common/port.h"
|
||||||
|
|
||||||
|
#define COM1 0x3f8
|
||||||
|
|
||||||
|
void dbgln(const char* str) {
|
||||||
|
while (*str != 0) {
|
||||||
|
outb(COM1, *str);
|
||||||
|
str++;
|
||||||
|
}
|
||||||
|
outb(COM1, '\n');
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
void dbgln(const char *str);
|
|
@ -1,13 +1,9 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define COM1 0x3f8
|
#include "debug/debug.h"
|
||||||
|
|
||||||
void outb(uint16_t port, uint8_t value) {
|
|
||||||
asm volatile("outb %0, %1" ::"a"(value), "Nd"(port));
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" void zion() {
|
extern "C" void zion() {
|
||||||
outb(COM1, 'a');
|
dbgln("Hello World!");
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in New Issue