-
Notifications
You must be signed in to change notification settings - Fork 2
/
system.h
70 lines (62 loc) · 2.2 KB
/
system.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//Kernel calls C Header
//String calls
int StringLength(char *string);
char *PrintString(char *string);
void PrintChar(char chr);
void PrintByteHex(char value);
void PrintHex(int value);
void PrintNewLine();
int UInt2Str(unsigned int value, char *buffer);
void PrintUInt(unsigned int value);
int Int2Str(signed int value, char *buffer);
void PrintInt(signed int value);
void PrintTitle(char *string);
void MemoryCopy(void *dest, void *source, int length);
void StringCopy(char *dest, char *source);
void SubStringCopy(char *dest, char *source, char *length);
void StringConcat(char *dest, char *source);
char StringCompare(char *str1, char *str2);
void DrawBox(int x, int y, int width, int height, int box);
void PrintStringL(char *string, int length);
int GetKey();
int ReadStringSafe(char *buffer, int maxLength);
int ReadString(char *buffer);
//Screen calls
int GetCursorPos();
void SetCursorPos(int pos);
void SetCursorPosXY(int x, int y);
void SetCursorAttribute(int attr);
int GetCursorAttribute();
void SetTextColor(int color);
void SetBackgroundColor(int color);
void FillBackgroundColor(int color);
void DisableCursorUpdate();
void EnableCursorUpdate();
void SetScreenPage(int page);
int GetScreenPage();
void ClearScreen();
void SetCursorOffset(int offset);
void ScrollScreen(int lines);
int GetScreenWidth();
int GetScreenHeight();
//Filesystem calls
int FindFile(char *filename);
int FindFile8_3(char *filename8_3);
bool ReadFile(char *filename, void *buffer, int segment);
bool ReadFile8_3(char *filename8_3, void *buffer, int segment);
void ReadFileEntry(int *rootDirEntry, void *buffer, int segment);
int GetFileCount();
int ListFiles(char *buffer, int start, int count);
//Disk calls
void ReadSector(int sector, int count, void *buffer, int segment);
void WriteSector(int sector, int count, void *buffer, int segment);
//Debug calls
void DumpMemory(int addr, int segment, int count);
void GetStackTrace(int *FrameBase);
//Program calls
int ExecProgram(int argc, char *argv[], int startIP, int segment);
//Memory calls
void InitHeap(void *heapStart, void *heapEnd, int blockSize);
void MemFree(void *heapStart, void *ptr);
void *MemAlloc(void *heapStart, int length);
void *MemRealloc(void *heapStart, void *ptr, int length);