Skip to content

Commit 2ebda4d

Browse files
committed
Added CPU I/O ports interaction functions and updated run.sh for more automated compilation
1 parent 5d2043f commit 2ebda4d

13 files changed

Lines changed: 93 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
boot.bin
2+
.vscode/*

build/OS.bin

328 Bytes
Binary file not shown.

build/full_kernel.bin

328 Bytes
Binary file not shown.

build/kernel.o

352 Bytes
Binary file not shown.

build/port_io.c.o

3.41 KB
Binary file not shown.
Binary file not shown.

build/vga_text_mode.c.o

2.55 KB
Binary file not shown.

kernel/kernel.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
extern void main()
44
{
5-
_printk("Hey! I am writing straight to video memory", 0x0f);
5+
printformat("Hey! I am writing straight to video memory", 0x0f);
6+
coords pos = {10, 0};
7+
set_cursor_position(pos);
68
return;
79
}

kernel/lib/std/datatypes.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,15 @@ typedef unsigned short int uint16_t;
1111
typedef unsigned int uint32_t;
1212
typedef unsigned long long int uint64_t;
1313

14+
// Boolean logic type
15+
typedef enum { false, true } bool;
16+
17+
// Stores coordinates
18+
typedef struct
19+
{
20+
uint8_t x;
21+
uint8_t y;
22+
} coords;
23+
24+
1425
#endif

kernel/lib/std/io.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#include "datatypes.h"
55
#include "../../drivers/port_io.h"
66

7-
void _printk(const char*, uint8_t);
7+
#define VGA_RESOLUTION 80
8+
9+
extern void printformat(const char* _string, uint8_t _color);
10+
11+
extern bool set_cursor_position(coords _pos);
812

913
#endif

0 commit comments

Comments
 (0)