Skip to content

Commit d08541f

Browse files
committed
ascii art
1 parent 36a79c4 commit d08541f

File tree

3 files changed

+51
-262
lines changed

3 files changed

+51
-262
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
out/
2-
*/**/bochsout.txt
3-
*/**/system.img
4-
*/**/bootloader
2+
**/*/bochsout.txt
3+
**/*/system.img
4+
**/*/bootloader

bochsout.txt

Lines changed: 0 additions & 249 deletions
This file was deleted.

src/kernel.c

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
void handleInterrupt21 (int AX, int BX, int CX, int DX);
2-
void printString(char *string);
3-
void readString(char *string);
4-
void clear(char *buffer, int length); // Fungsi untuk mengisi buffer dengan 0
2+
void printString(char * string);
3+
void readString(char * string);
4+
void clear(char *buffer, int length);
5+
void printLogo();
6+
void logo(char * string, int y);
7+
8+
#define VIDMEM 0xB000
9+
#define OFFSET 0x8000
510

611
int main() {
712
char tes[16];
813
interrupt(0x10, 0x0003, 0, 0);
9-
makeInterrupt21();
10-
readString(tes);
14+
printLogo();
15+
// makeInterrupt21();
16+
// readString(tes);
1117
// tes[0]='A';
1218
// tes[1]='B';
1319
// tes[2]='C';
1420
// tes[3]='\0';
15-
printString(tes);
16-
clear(tes,16);
21+
// printString(tes);
22+
// clear(tes,16);
1723
while (1);
1824
}
1925

@@ -52,9 +58,41 @@ void readString(char *string) {
5258
}
5359
}
5460

55-
void clear(char *buffer, int length){
61+
void clear(char *buffer, int length) {
5662
int i;
57-
for(i=0;i<length;i++){
58-
buffer[i]=0;
63+
for (i = 0; i < length; i++) {
64+
buffer[i] = 0;
65+
}
66+
}
67+
68+
void printLogo() {
69+
logo(" `...........` `...` ...` `.....`` `..` `..`",0);
70+
logo(" `...........` `...` ...` `.....`` `..` `..`",1);
71+
logo(" ..............` `.... `.... `.........` .... `....",2);
72+
logo(" .....`````..... `.... `.... ....` ``` .... `....",3);
73+
logo(" ..--` `.... `.... ..... .....`` ....``` `....",4);
74+
logo(" //ooo+:-...-:////. -:-.. :o/:. `../+oo/. ..-/+oo+:-",5);
75+
logo(" +ooo+//:-:::.` /oo+: /ooo/ `-/oooo+``+ooooooooo+//",6);
76+
logo(" +ooo: ``````. -ooo+` `/ooo: .+ooo:`oooo.```-ooo+",7);
77+
logo(" +ooo: -------. /ooo+:-:+ooo/``/+/:-:+ooo.`ooo+` -ooo+",8);
78+
logo(" /ooo- +++++:.-. `-+ooooooo+-` `+ooooooo+- `ooo+` .ooo/",9);
79+
logo(" `-:. .++++++:--.` ``.-:-.`` `` ``.-::-.` ` `--` `. .--`",10);
80+
}
81+
82+
void logo(char * string, int y) {
83+
int j = 0;
84+
while (string[j] != '\0') {
85+
putInMemory(VIDMEM, OFFSET + (80 * y + j) * 2, string[j]);
86+
j++;
87+
switch (string[j]) {
88+
case 'o':
89+
putInMemory(VIDMEM, OFFSET + (80 * y + j) * 2 + 1, 0xE);
90+
break;
91+
case '.':
92+
putInMemory(VIDMEM, OFFSET + (80 * y + j) * 2 + 1, 0x9);
93+
break;
94+
default:
95+
break;
96+
}
5997
}
6098
}

0 commit comments

Comments
 (0)