-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.c
More file actions
73 lines (42 loc) · 834 Bytes
/
kernel.c
File metadata and controls
73 lines (42 loc) · 834 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#define BRANCO_TXT 0x07
void k_cls();
unsigned int k_printf(char *message,unsigned int linha);
void update_cursor(int linha, int coluna);
k_main()
{
k_cls();
k_printf("Kernel executado com sucesso!!!\nExito na exececucao.",0);
};
void k_cls()
{
char *vidmem = (char *) 0x8000;
unsigned int i=0;
while(i < (80*25*2)){
vidmem[i] = ' ';
i++;
vidmem[i] = BRANCO_TXT;
i++;
};
};
unsigned int k_printf(char *message, unsigned int linha) // a mensagem e então a linha #
{
char *vidmem = (char *) 0xb8000;
unsigned int i=0;
i=(linha*80*2);
while(*message!=0)
{
if(*message=='\n') // checa para nova linha
{
linha++;
i=(linha*80*2);
*message++;
} else {
vidmem[i]=*message;
*message++;
i++;
vidmem[i]=BRANCO_TXT;
i++;
};
};
return(1);
};