Began work on proper terminal I/O

- Chenged Puts() syscall to Write()
- Improved syscalls.h
- added a new header in terminal/terminal.h
- moved gfxMode into screen/gfxmode.h
This commit is contained in:
2024-05-27 15:16:07 +02:00
parent eac71f137e
commit 536f6b2320
11 changed files with 285 additions and 111 deletions
+35
View File
@@ -0,0 +1,35 @@
--- Terminal Escape Sequences ---
Escape character:
char: '\e'
hex: 0x1b
oct: 0o33
dec: 27
Note: the escape character will be denoted by ESC here
Syntax:
All escape sequenced start with the escape character followed by an opening square bracket '['
The sequence can take any number of arguments in a semicolon separated list
If a argument is skipped, it will be implicitly set to 0
The escape sequence must end with a uppercase or lowercase letter
Available escape sequences:
- Cursor Controls -
`ESC[#A` - Moves cursor # rows up
`ESC[#B` - Moves cursor # rows down
`ESC[#C` - Moves cursor # columns left
`ESC[#D` - Moves cursor # columns right
`ESC[#E` - Moves cursor to #th row
`ESC[#F` - Moves cursor to #th column
`ESC[#G` - Show (# = 1) or hide (# = 0) cursor
`ESC[{row};{col}H` - Moves cursor to specified position (if not arguments given, moves to [0,0])a
- Erase functions -
`ESC[I` - Reserved
`ESC[J` - Erase screen
`ESC[K` - Erase line (not implemented)
`ESC[L` - Erase column (not implemented)
- Text Style -
`ESC[#M` - Sets foreground color to #
`ESC[#N` - Sets backgorund color to #
-8
View File
@@ -1,8 +0,0 @@
--- Memory Map ---
0x1000 - Kernel
0x6000 - Font
0x7000 - Filetable (0x7c00 - Bootloader)
0x8500 - ACPI Memory map
0x9000 - VBE Mode Info Block
0x30000 - Memory manager memmap
+17 -2
View File
@@ -2,10 +2,25 @@
Syscall handlers are prefixed by 'sys_'
Syscalls can be called using interrupt 0x80
The EAX register should countain a syscall number
The EAX register should countain a syscall number on calling and it will contain a return value (if applicable) after calling
Here's a list of syscalls: (and their numbers)
syscall(0) : Sleep()
Syscall(0) : Sleep()
Args: EBX - Number of miliseconds to sleep for
Syscall(1) : Write()
Args: EBX - File descriptor
ECX - Buffer to write
EDX - Length
Returns: Status
Syscall(2) : Read() #TBD
Syscall(3) : Malloc()
Args: EBX - Amount of bytes to malloc
Returns: Address of allocated memory
Syscall(4) : Free()
Args: EBX - Pointer to free