ref(libterm): now apple-styled too
This commit is contained in:
@@ -4,5 +4,5 @@
|
||||
#pragma once
|
||||
#include <types.h>
|
||||
|
||||
UInt64 OSServiceWrite(UInt64 fileDescriptor, UInt64 buffer, UInt64 length);
|
||||
UInt64 OSServiceRead(UInt64 fileDescriptor, UInt64 buffer, UInt64 count);
|
||||
UInt64 OSServiceIOWrite(UInt64 fileDescriptor, UInt64 buffer, UInt64 length);
|
||||
UInt64 OSServiceIORead(UInt64 fileDescriptor, UInt64 buffer, UInt64 count);
|
||||
@@ -4,4 +4,4 @@
|
||||
#pragma once
|
||||
#include <types.h>
|
||||
|
||||
UInt64 OSServiceMemoryGet(UInt64 size);
|
||||
UInt64 OSServiceMemoryAllocate(UInt64 size);
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <IO/IOConsole.h>
|
||||
#include <IO/IOKeyboard.h>
|
||||
|
||||
UInt64 OSServiceWrite(UInt64 fileDescriptor, UInt64 buffer, UInt64 length) {
|
||||
UInt64 OSServiceIOWrite(UInt64 fileDescriptor, UInt64 buffer, UInt64 length) {
|
||||
if (fileDescriptor == 1 || fileDescriptor == 2) {
|
||||
char* string = (char*)buffer;
|
||||
for (UInt64 i = 0; i < length; i++) {
|
||||
@@ -16,7 +16,7 @@ UInt64 OSServiceWrite(UInt64 fileDescriptor, UInt64 buffer, UInt64 length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
UInt64 OSServiceRead(UInt64 fileDescriptor, UInt64 buffer, UInt64 count) {
|
||||
UInt64 OSServiceIORead(UInt64 fileDescriptor, UInt64 buffer, UInt64 count) {
|
||||
char* readBuffer = (char*)buffer;
|
||||
if (fileDescriptor == 0) {
|
||||
for (UInt64 i = 0; i < count; i++) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <VM/VMM.h>
|
||||
#include <lib/String.h>
|
||||
|
||||
UInt64 OSServiceMemoryGet(UInt64 size) {
|
||||
UInt64 OSServiceMemoryAllocate(UInt64 size) {
|
||||
if (size == 0) return 0;
|
||||
OSProcess* currentProcess = gOSSchedulerCurrentTask->process;
|
||||
UInt64 addressToReturn = currentProcess->heapCurrentPointer;
|
||||
|
||||
@@ -55,9 +55,9 @@ UInt64 syscall_dispatch(UInt64 id, UInt64 arg1, UInt64 arg2, UInt64 arg3, UInt64
|
||||
switch (id) {
|
||||
case SYS_EXIT: return OSServiceProcessExit(arg1);
|
||||
case SYS_SPAWN: return OSServiceProcessSpawn((const char*)arg1);
|
||||
case SYS_MEM: return OSServiceMemoryGet(arg1);
|
||||
case SYS_WRITE: return OSServiceWrite(arg1, arg2, arg3);
|
||||
case SYS_READ: return OSServiceRead(arg1, arg2, arg3);
|
||||
case SYS_MEM: return OSServiceMemoryAllocate(arg1);
|
||||
case SYS_WRITE: return OSServiceIOWrite(arg1, arg2, arg3);
|
||||
case SYS_READ: return OSServiceIORead(arg1, arg2, arg3);
|
||||
case SYS_WAIT: return OSServiceProcessWait(arg1);
|
||||
default:
|
||||
IOConsoleLog("[Dewar] Unknown syscall %d\n", id);
|
||||
|
||||
Reference in New Issue
Block a user