-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkernel.c
More file actions
49 lines (42 loc) · 839 Bytes
/
Copy pathkernel.c
File metadata and controls
49 lines (42 loc) · 839 Bytes
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
int video=0xb8000;
void printc(char b)
{
int i=video;
char *fbp=(char* )i;
*((char *)(fbp)) =(char)b;
*((char *)(fbp+1)) =(char)0x07;
video++;
video++;
}
void prints(char *c)
{
int counter=0;
while(c[counter]!=0){
printc(c[counter]);
counter++;
}
}
void exits(){
halts:
goto halts;
}
void cls(){
char *dest=(char* )0xb8000;
int i=0;
int length=4000;
unsigned int value=0x07;
// Cast o ponteiro para unsigned char* para permitir o preenchimento byte a byte
unsigned char *d = (unsigned char *)dest;
// Preencha os bytes da memória com o valor especificado
for (i = 0; i < length; i=i+2) {
d[i] = 32;
d[i+1] = value;
}
}
void kmain(){
char *c="hello world...";
video=0xb8000;
cls();
prints(c);
exits();
}