diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/userland/ioManager/main.c b/src/userland/ioManager/main.c index 31caa0e..f1c0a9a 100644 --- a/src/userland/ioManager/main.c +++ b/src/userland/ioManager/main.c @@ -28,6 +28,7 @@ for (uint32_t i = 0; buffer[i]; i++) { request(mainService, mainOut, buffer[i], 0); } + return; } writeString("[ "); readString(caller, buffer); @@ -38,7 +39,9 @@ writeString(" ] "); readString(stringId, buffer); writeString(buffer); - writeString("\r\n"); + if (buffer[strlen(buffer) - 1] != '\n') { + writeString("\n"); + } lock = false; } diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/userland/ioManager/main.c b/src/userland/ioManager/main.c index 31caa0e..f1c0a9a 100644 --- a/src/userland/ioManager/main.c +++ b/src/userland/ioManager/main.c @@ -28,6 +28,7 @@ for (uint32_t i = 0; buffer[i]; i++) { request(mainService, mainOut, buffer[i], 0); } + return; } writeString("[ "); readString(caller, buffer); @@ -38,7 +39,9 @@ writeString(" ] "); readString(stringId, buffer); writeString(buffer); - writeString("\r\n"); + if (buffer[strlen(buffer) - 1] != '\n') { + writeString("\n"); + } lock = false; } diff --git a/src/userland/keyboard/main.c b/src/userland/keyboard/main.c index 8289163..8d1cc9e 100644 --- a/src/userland/keyboard/main.c +++ b/src/userland/keyboard/main.c @@ -60,7 +60,7 @@ if (scancode & 0x80) { return; } - printf("key press %s detected", altKeycodes[scancode]); + printf("key press %s detected\n", altKeycodes[scancode]); return; } if (scancode & 0x80) { @@ -84,12 +84,12 @@ } else { data = keycodes[scancode]; } - printf("key press %c detected", data); + printf("key press %c detected\n", data); } int32_t main() { uint32_t service = getService("pic"); uint32_t event = getEvent(service, "irq1"); subscribeEvent(service, event, onKey); - log("keyboard handler installed"); + printf("keyboard handler installed\n"); } diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/userland/ioManager/main.c b/src/userland/ioManager/main.c index 31caa0e..f1c0a9a 100644 --- a/src/userland/ioManager/main.c +++ b/src/userland/ioManager/main.c @@ -28,6 +28,7 @@ for (uint32_t i = 0; buffer[i]; i++) { request(mainService, mainOut, buffer[i], 0); } + return; } writeString("[ "); readString(caller, buffer); @@ -38,7 +39,9 @@ writeString(" ] "); readString(stringId, buffer); writeString(buffer); - writeString("\r\n"); + if (buffer[strlen(buffer) - 1] != '\n') { + writeString("\n"); + } lock = false; } diff --git a/src/userland/keyboard/main.c b/src/userland/keyboard/main.c index 8289163..8d1cc9e 100644 --- a/src/userland/keyboard/main.c +++ b/src/userland/keyboard/main.c @@ -60,7 +60,7 @@ if (scancode & 0x80) { return; } - printf("key press %s detected", altKeycodes[scancode]); + printf("key press %s detected\n", altKeycodes[scancode]); return; } if (scancode & 0x80) { @@ -84,12 +84,12 @@ } else { data = keycodes[scancode]; } - printf("key press %c detected", data); + printf("key press %c detected\n", data); } int32_t main() { uint32_t service = getService("pic"); uint32_t event = getEvent(service, "irq1"); subscribeEvent(service, event, onKey); - log("keyboard handler installed"); + printf("keyboard handler installed\n"); } diff --git a/src/userland/loader/main.c b/src/userland/loader/main.c index 483b25d..aead40a 100644 --- a/src/userland/loader/main.c +++ b/src/userland/loader/main.c @@ -5,8 +5,8 @@ int32_t main() { loadFromInitrd("ioManager"); - printf("HONEY-OS - made by Lukas Eisenhauer"); - printf("finished loading all the essential modules"); + printf("HONEY-OS - made by Lukas Eisenhauer\n"); + printf("finished loading all the essential modules\n"); loadFromInitrd("crashTest"); uint32_t id = loadFromInitrdUninitialized("shell"); requestName("ioManager", "setForeground", id, 0); diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/userland/ioManager/main.c b/src/userland/ioManager/main.c index 31caa0e..f1c0a9a 100644 --- a/src/userland/ioManager/main.c +++ b/src/userland/ioManager/main.c @@ -28,6 +28,7 @@ for (uint32_t i = 0; buffer[i]; i++) { request(mainService, mainOut, buffer[i], 0); } + return; } writeString("[ "); readString(caller, buffer); @@ -38,7 +39,9 @@ writeString(" ] "); readString(stringId, buffer); writeString(buffer); - writeString("\r\n"); + if (buffer[strlen(buffer) - 1] != '\n') { + writeString("\n"); + } lock = false; } diff --git a/src/userland/keyboard/main.c b/src/userland/keyboard/main.c index 8289163..8d1cc9e 100644 --- a/src/userland/keyboard/main.c +++ b/src/userland/keyboard/main.c @@ -60,7 +60,7 @@ if (scancode & 0x80) { return; } - printf("key press %s detected", altKeycodes[scancode]); + printf("key press %s detected\n", altKeycodes[scancode]); return; } if (scancode & 0x80) { @@ -84,12 +84,12 @@ } else { data = keycodes[scancode]; } - printf("key press %c detected", data); + printf("key press %c detected\n", data); } int32_t main() { uint32_t service = getService("pic"); uint32_t event = getEvent(service, "irq1"); subscribeEvent(service, event, onKey); - log("keyboard handler installed"); + printf("keyboard handler installed\n"); } diff --git a/src/userland/loader/main.c b/src/userland/loader/main.c index 483b25d..aead40a 100644 --- a/src/userland/loader/main.c +++ b/src/userland/loader/main.c @@ -5,8 +5,8 @@ int32_t main() { loadFromInitrd("ioManager"); - printf("HONEY-OS - made by Lukas Eisenhauer"); - printf("finished loading all the essential modules"); + printf("HONEY-OS - made by Lukas Eisenhauer\n"); + printf("finished loading all the essential modules\n"); loadFromInitrd("crashTest"); uint32_t id = loadFromInitrdUninitialized("shell"); requestName("ioManager", "setForeground", id, 0); diff --git a/src/userland/log/main.c b/src/userland/log/main.c index 232efd0..c683da3 100644 --- a/src/userland/log/main.c +++ b/src/userland/log/main.c @@ -23,7 +23,7 @@ void onInitrdLoad(uint32_t programName) { readString(programName, buffer); - printf("loading '%s' from initrd", buffer); + printf("loading '%s' from initrd\n", buffer); } typedef struct StackFrame { @@ -34,13 +34,13 @@ void trace(void *address, uint32_t serviceId) { uint32_t name = lookupSymbol(serviceId, U32(address)); readString(name, buffer); - printf("0x%x / %s", address, buffer); + printf("0x%x / %s\n", address, buffer); } void onException(uint32_t intNo, uint32_t errorCode, void *crashAddress, void *start, uint32_t serviceName, uint32_t serviceId) { readString(serviceName, buffer); - printf("service \"%s\" encountered a %s. Stacktrace:", buffer, + printf("service \"%s\" encountered a %s. Stacktrace:\n", buffer, EXCEPTION_NAMES[intNo]); StackFrame *frame = requestMemory(1, NULL, start); trace(crashAddress, serviceId); diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/userland/ioManager/main.c b/src/userland/ioManager/main.c index 31caa0e..f1c0a9a 100644 --- a/src/userland/ioManager/main.c +++ b/src/userland/ioManager/main.c @@ -28,6 +28,7 @@ for (uint32_t i = 0; buffer[i]; i++) { request(mainService, mainOut, buffer[i], 0); } + return; } writeString("[ "); readString(caller, buffer); @@ -38,7 +39,9 @@ writeString(" ] "); readString(stringId, buffer); writeString(buffer); - writeString("\r\n"); + if (buffer[strlen(buffer) - 1] != '\n') { + writeString("\n"); + } lock = false; } diff --git a/src/userland/keyboard/main.c b/src/userland/keyboard/main.c index 8289163..8d1cc9e 100644 --- a/src/userland/keyboard/main.c +++ b/src/userland/keyboard/main.c @@ -60,7 +60,7 @@ if (scancode & 0x80) { return; } - printf("key press %s detected", altKeycodes[scancode]); + printf("key press %s detected\n", altKeycodes[scancode]); return; } if (scancode & 0x80) { @@ -84,12 +84,12 @@ } else { data = keycodes[scancode]; } - printf("key press %c detected", data); + printf("key press %c detected\n", data); } int32_t main() { uint32_t service = getService("pic"); uint32_t event = getEvent(service, "irq1"); subscribeEvent(service, event, onKey); - log("keyboard handler installed"); + printf("keyboard handler installed\n"); } diff --git a/src/userland/loader/main.c b/src/userland/loader/main.c index 483b25d..aead40a 100644 --- a/src/userland/loader/main.c +++ b/src/userland/loader/main.c @@ -5,8 +5,8 @@ int32_t main() { loadFromInitrd("ioManager"); - printf("HONEY-OS - made by Lukas Eisenhauer"); - printf("finished loading all the essential modules"); + printf("HONEY-OS - made by Lukas Eisenhauer\n"); + printf("finished loading all the essential modules\n"); loadFromInitrd("crashTest"); uint32_t id = loadFromInitrdUninitialized("shell"); requestName("ioManager", "setForeground", id, 0); diff --git a/src/userland/log/main.c b/src/userland/log/main.c index 232efd0..c683da3 100644 --- a/src/userland/log/main.c +++ b/src/userland/log/main.c @@ -23,7 +23,7 @@ void onInitrdLoad(uint32_t programName) { readString(programName, buffer); - printf("loading '%s' from initrd", buffer); + printf("loading '%s' from initrd\n", buffer); } typedef struct StackFrame { @@ -34,13 +34,13 @@ void trace(void *address, uint32_t serviceId) { uint32_t name = lookupSymbol(serviceId, U32(address)); readString(name, buffer); - printf("0x%x / %s", address, buffer); + printf("0x%x / %s\n", address, buffer); } void onException(uint32_t intNo, uint32_t errorCode, void *crashAddress, void *start, uint32_t serviceName, uint32_t serviceId) { readString(serviceName, buffer); - printf("service \"%s\" encountered a %s. Stacktrace:", buffer, + printf("service \"%s\" encountered a %s. Stacktrace:\n", buffer, EXCEPTION_NAMES[intNo]); StackFrame *frame = requestMemory(1, NULL, start); trace(crashAddress, serviceId); diff --git a/src/userland/parallel/main.c b/src/userland/parallel/main.c index f660d43..3f03be1 100644 --- a/src/userland/parallel/main.c +++ b/src/userland/parallel/main.c @@ -2,7 +2,10 @@ uint32_t event0, event1; -void parallelOut(void *data, uint32_t dataLength) { +void parallelOut(uint32_t data, uint32_t dataLength) { + if (data == '\n') { + parallelOut('\r', 0); + } uint8_t control; while (!(ioIn(0x379, sizeof(uint8_t)) & 0x80)) { } diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/userland/ioManager/main.c b/src/userland/ioManager/main.c index 31caa0e..f1c0a9a 100644 --- a/src/userland/ioManager/main.c +++ b/src/userland/ioManager/main.c @@ -28,6 +28,7 @@ for (uint32_t i = 0; buffer[i]; i++) { request(mainService, mainOut, buffer[i], 0); } + return; } writeString("[ "); readString(caller, buffer); @@ -38,7 +39,9 @@ writeString(" ] "); readString(stringId, buffer); writeString(buffer); - writeString("\r\n"); + if (buffer[strlen(buffer) - 1] != '\n') { + writeString("\n"); + } lock = false; } diff --git a/src/userland/keyboard/main.c b/src/userland/keyboard/main.c index 8289163..8d1cc9e 100644 --- a/src/userland/keyboard/main.c +++ b/src/userland/keyboard/main.c @@ -60,7 +60,7 @@ if (scancode & 0x80) { return; } - printf("key press %s detected", altKeycodes[scancode]); + printf("key press %s detected\n", altKeycodes[scancode]); return; } if (scancode & 0x80) { @@ -84,12 +84,12 @@ } else { data = keycodes[scancode]; } - printf("key press %c detected", data); + printf("key press %c detected\n", data); } int32_t main() { uint32_t service = getService("pic"); uint32_t event = getEvent(service, "irq1"); subscribeEvent(service, event, onKey); - log("keyboard handler installed"); + printf("keyboard handler installed\n"); } diff --git a/src/userland/loader/main.c b/src/userland/loader/main.c index 483b25d..aead40a 100644 --- a/src/userland/loader/main.c +++ b/src/userland/loader/main.c @@ -5,8 +5,8 @@ int32_t main() { loadFromInitrd("ioManager"); - printf("HONEY-OS - made by Lukas Eisenhauer"); - printf("finished loading all the essential modules"); + printf("HONEY-OS - made by Lukas Eisenhauer\n"); + printf("finished loading all the essential modules\n"); loadFromInitrd("crashTest"); uint32_t id = loadFromInitrdUninitialized("shell"); requestName("ioManager", "setForeground", id, 0); diff --git a/src/userland/log/main.c b/src/userland/log/main.c index 232efd0..c683da3 100644 --- a/src/userland/log/main.c +++ b/src/userland/log/main.c @@ -23,7 +23,7 @@ void onInitrdLoad(uint32_t programName) { readString(programName, buffer); - printf("loading '%s' from initrd", buffer); + printf("loading '%s' from initrd\n", buffer); } typedef struct StackFrame { @@ -34,13 +34,13 @@ void trace(void *address, uint32_t serviceId) { uint32_t name = lookupSymbol(serviceId, U32(address)); readString(name, buffer); - printf("0x%x / %s", address, buffer); + printf("0x%x / %s\n", address, buffer); } void onException(uint32_t intNo, uint32_t errorCode, void *crashAddress, void *start, uint32_t serviceName, uint32_t serviceId) { readString(serviceName, buffer); - printf("service \"%s\" encountered a %s. Stacktrace:", buffer, + printf("service \"%s\" encountered a %s. Stacktrace:\n", buffer, EXCEPTION_NAMES[intNo]); StackFrame *frame = requestMemory(1, NULL, start); trace(crashAddress, serviceId); diff --git a/src/userland/parallel/main.c b/src/userland/parallel/main.c index f660d43..3f03be1 100644 --- a/src/userland/parallel/main.c +++ b/src/userland/parallel/main.c @@ -2,7 +2,10 @@ uint32_t event0, event1; -void parallelOut(void *data, uint32_t dataLength) { +void parallelOut(uint32_t data, uint32_t dataLength) { + if (data == '\n') { + parallelOut('\r', 0); + } uint8_t control; while (!(ioIn(0x379, sizeof(uint8_t)) & 0x80)) { } diff --git a/src/userland/pic/main.c b/src/userland/pic/main.c index 395adc2..7ceffa1 100644 --- a/src/userland/pic/main.c +++ b/src/userland/pic/main.c @@ -1,3 +1,5 @@ +#define ALLOC_MAIN + #include #include #include @@ -45,7 +47,7 @@ } int32_t main() { - log("setting up interrupt handlers for the PIC"); + printf("setting up interrupt handlers for the PIC\n"); for (uint32_t i = 32; i < 48; i++) { subscribeInterrupt(i, irqMaster); } diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/userland/ioManager/main.c b/src/userland/ioManager/main.c index 31caa0e..f1c0a9a 100644 --- a/src/userland/ioManager/main.c +++ b/src/userland/ioManager/main.c @@ -28,6 +28,7 @@ for (uint32_t i = 0; buffer[i]; i++) { request(mainService, mainOut, buffer[i], 0); } + return; } writeString("[ "); readString(caller, buffer); @@ -38,7 +39,9 @@ writeString(" ] "); readString(stringId, buffer); writeString(buffer); - writeString("\r\n"); + if (buffer[strlen(buffer) - 1] != '\n') { + writeString("\n"); + } lock = false; } diff --git a/src/userland/keyboard/main.c b/src/userland/keyboard/main.c index 8289163..8d1cc9e 100644 --- a/src/userland/keyboard/main.c +++ b/src/userland/keyboard/main.c @@ -60,7 +60,7 @@ if (scancode & 0x80) { return; } - printf("key press %s detected", altKeycodes[scancode]); + printf("key press %s detected\n", altKeycodes[scancode]); return; } if (scancode & 0x80) { @@ -84,12 +84,12 @@ } else { data = keycodes[scancode]; } - printf("key press %c detected", data); + printf("key press %c detected\n", data); } int32_t main() { uint32_t service = getService("pic"); uint32_t event = getEvent(service, "irq1"); subscribeEvent(service, event, onKey); - log("keyboard handler installed"); + printf("keyboard handler installed\n"); } diff --git a/src/userland/loader/main.c b/src/userland/loader/main.c index 483b25d..aead40a 100644 --- a/src/userland/loader/main.c +++ b/src/userland/loader/main.c @@ -5,8 +5,8 @@ int32_t main() { loadFromInitrd("ioManager"); - printf("HONEY-OS - made by Lukas Eisenhauer"); - printf("finished loading all the essential modules"); + printf("HONEY-OS - made by Lukas Eisenhauer\n"); + printf("finished loading all the essential modules\n"); loadFromInitrd("crashTest"); uint32_t id = loadFromInitrdUninitialized("shell"); requestName("ioManager", "setForeground", id, 0); diff --git a/src/userland/log/main.c b/src/userland/log/main.c index 232efd0..c683da3 100644 --- a/src/userland/log/main.c +++ b/src/userland/log/main.c @@ -23,7 +23,7 @@ void onInitrdLoad(uint32_t programName) { readString(programName, buffer); - printf("loading '%s' from initrd", buffer); + printf("loading '%s' from initrd\n", buffer); } typedef struct StackFrame { @@ -34,13 +34,13 @@ void trace(void *address, uint32_t serviceId) { uint32_t name = lookupSymbol(serviceId, U32(address)); readString(name, buffer); - printf("0x%x / %s", address, buffer); + printf("0x%x / %s\n", address, buffer); } void onException(uint32_t intNo, uint32_t errorCode, void *crashAddress, void *start, uint32_t serviceName, uint32_t serviceId) { readString(serviceName, buffer); - printf("service \"%s\" encountered a %s. Stacktrace:", buffer, + printf("service \"%s\" encountered a %s. Stacktrace:\n", buffer, EXCEPTION_NAMES[intNo]); StackFrame *frame = requestMemory(1, NULL, start); trace(crashAddress, serviceId); diff --git a/src/userland/parallel/main.c b/src/userland/parallel/main.c index f660d43..3f03be1 100644 --- a/src/userland/parallel/main.c +++ b/src/userland/parallel/main.c @@ -2,7 +2,10 @@ uint32_t event0, event1; -void parallelOut(void *data, uint32_t dataLength) { +void parallelOut(uint32_t data, uint32_t dataLength) { + if (data == '\n') { + parallelOut('\r', 0); + } uint8_t control; while (!(ioIn(0x379, sizeof(uint8_t)) & 0x80)) { } diff --git a/src/userland/pic/main.c b/src/userland/pic/main.c index 395adc2..7ceffa1 100644 --- a/src/userland/pic/main.c +++ b/src/userland/pic/main.c @@ -1,3 +1,5 @@ +#define ALLOC_MAIN + #include #include #include @@ -45,7 +47,7 @@ } int32_t main() { - log("setting up interrupt handlers for the PIC"); + printf("setting up interrupt handlers for the PIC\n"); for (uint32_t i = 32; i < 48; i++) { subscribeInterrupt(i, irqMaster); } diff --git a/src/userland/shell/main.c b/src/userland/shell/main.c index 871a389..69df12e 100644 --- a/src/userland/shell/main.c +++ b/src/userland/shell/main.c @@ -3,4 +3,4 @@ #include #include -int32_t main() { printf("HONEY-OS - made by Lukas Eisenhauer"); } +int32_t main() { printf("HONEY-OS - made by Lukas Eisenhauer\n"); } diff --git a/src/include/hlib.h b/src/include/hlib.h index 594c104..c57b875 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -19,7 +19,6 @@ extern uint32_t strlen(char *string); extern uint32_t ioIn(uint16_t port, uint8_t size); extern void ioOut(uint16_t port, uint32_t value, uint8_t size); -extern void log(char *); extern void subscribeInterrupt(uint32_t intNo, void *handler); extern uint32_t loadFromInitrd(char *name); extern uint32_t loadFromInitrdUninitialized(char *name); diff --git a/src/userland/crashTest/main.c b/src/userland/crashTest/main.c index 5537ed1..375b198 100644 --- a/src/userland/crashTest/main.c +++ b/src/userland/crashTest/main.c @@ -3,10 +3,10 @@ #include #include -void testFunction() { printf("0/0 = %i", 0 / 0); } +void testFunction() { printf("0/0 = %i\n", 0 / 0); } int32_t main() { - printf("trying to divide by zero now . . . "); + printf("trying to divide by zero now . . .\n"); testFunction(); return 0; } diff --git a/src/userland/ioManager/main.c b/src/userland/ioManager/main.c index 31caa0e..f1c0a9a 100644 --- a/src/userland/ioManager/main.c +++ b/src/userland/ioManager/main.c @@ -28,6 +28,7 @@ for (uint32_t i = 0; buffer[i]; i++) { request(mainService, mainOut, buffer[i], 0); } + return; } writeString("[ "); readString(caller, buffer); @@ -38,7 +39,9 @@ writeString(" ] "); readString(stringId, buffer); writeString(buffer); - writeString("\r\n"); + if (buffer[strlen(buffer) - 1] != '\n') { + writeString("\n"); + } lock = false; } diff --git a/src/userland/keyboard/main.c b/src/userland/keyboard/main.c index 8289163..8d1cc9e 100644 --- a/src/userland/keyboard/main.c +++ b/src/userland/keyboard/main.c @@ -60,7 +60,7 @@ if (scancode & 0x80) { return; } - printf("key press %s detected", altKeycodes[scancode]); + printf("key press %s detected\n", altKeycodes[scancode]); return; } if (scancode & 0x80) { @@ -84,12 +84,12 @@ } else { data = keycodes[scancode]; } - printf("key press %c detected", data); + printf("key press %c detected\n", data); } int32_t main() { uint32_t service = getService("pic"); uint32_t event = getEvent(service, "irq1"); subscribeEvent(service, event, onKey); - log("keyboard handler installed"); + printf("keyboard handler installed\n"); } diff --git a/src/userland/loader/main.c b/src/userland/loader/main.c index 483b25d..aead40a 100644 --- a/src/userland/loader/main.c +++ b/src/userland/loader/main.c @@ -5,8 +5,8 @@ int32_t main() { loadFromInitrd("ioManager"); - printf("HONEY-OS - made by Lukas Eisenhauer"); - printf("finished loading all the essential modules"); + printf("HONEY-OS - made by Lukas Eisenhauer\n"); + printf("finished loading all the essential modules\n"); loadFromInitrd("crashTest"); uint32_t id = loadFromInitrdUninitialized("shell"); requestName("ioManager", "setForeground", id, 0); diff --git a/src/userland/log/main.c b/src/userland/log/main.c index 232efd0..c683da3 100644 --- a/src/userland/log/main.c +++ b/src/userland/log/main.c @@ -23,7 +23,7 @@ void onInitrdLoad(uint32_t programName) { readString(programName, buffer); - printf("loading '%s' from initrd", buffer); + printf("loading '%s' from initrd\n", buffer); } typedef struct StackFrame { @@ -34,13 +34,13 @@ void trace(void *address, uint32_t serviceId) { uint32_t name = lookupSymbol(serviceId, U32(address)); readString(name, buffer); - printf("0x%x / %s", address, buffer); + printf("0x%x / %s\n", address, buffer); } void onException(uint32_t intNo, uint32_t errorCode, void *crashAddress, void *start, uint32_t serviceName, uint32_t serviceId) { readString(serviceName, buffer); - printf("service \"%s\" encountered a %s. Stacktrace:", buffer, + printf("service \"%s\" encountered a %s. Stacktrace:\n", buffer, EXCEPTION_NAMES[intNo]); StackFrame *frame = requestMemory(1, NULL, start); trace(crashAddress, serviceId); diff --git a/src/userland/parallel/main.c b/src/userland/parallel/main.c index f660d43..3f03be1 100644 --- a/src/userland/parallel/main.c +++ b/src/userland/parallel/main.c @@ -2,7 +2,10 @@ uint32_t event0, event1; -void parallelOut(void *data, uint32_t dataLength) { +void parallelOut(uint32_t data, uint32_t dataLength) { + if (data == '\n') { + parallelOut('\r', 0); + } uint8_t control; while (!(ioIn(0x379, sizeof(uint8_t)) & 0x80)) { } diff --git a/src/userland/pic/main.c b/src/userland/pic/main.c index 395adc2..7ceffa1 100644 --- a/src/userland/pic/main.c +++ b/src/userland/pic/main.c @@ -1,3 +1,5 @@ +#define ALLOC_MAIN + #include #include #include @@ -45,7 +47,7 @@ } int32_t main() { - log("setting up interrupt handlers for the PIC"); + printf("setting up interrupt handlers for the PIC\n"); for (uint32_t i = 32; i < 48; i++) { subscribeInterrupt(i, irqMaster); } diff --git a/src/userland/shell/main.c b/src/userland/shell/main.c index 871a389..69df12e 100644 --- a/src/userland/shell/main.c +++ b/src/userland/shell/main.c @@ -3,4 +3,4 @@ #include #include -int32_t main() { printf("HONEY-OS - made by Lukas Eisenhauer"); } +int32_t main() { printf("HONEY-OS - made by Lukas Eisenhauer\n"); } diff --git a/src/userland/vga/main.c b/src/userland/vga/main.c index 1431166..ec1eb13 100644 --- a/src/userland/vga/main.c +++ b/src/userland/vga/main.c @@ -20,7 +20,7 @@ offset = (offset / WIDTH) * WIDTH; return; case '\n': - offset += WIDTH; + offset = (offset / WIDTH + 1) * WIDTH; return; } writeChar(c, COLOR(white, black));