This repository was archived by the owner on Jun 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib_c.h
More file actions
53 lines (41 loc) · 1.37 KB
/
lib_c.h
File metadata and controls
53 lines (41 loc) · 1.37 KB
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
#ifndef LIB_C_H_
#define LIB_C_H_
#define NULL 0
unsigned long irq_count[ 256 ];
typedef struct {
unsigned short gs __attribute__((aligned(4)));
unsigned short fs __attribute__((aligned(4)));
unsigned short es __attribute__((aligned(4)));
unsigned short ds __attribute__((aligned(4)));
unsigned long edi;
unsigned long esi;
unsigned long ebp;
unsigned long esp;
unsigned long ebx;
unsigned long edx;
unsigned long ecx;
unsigned long eax;
unsigned char error_code __attribute__((aligned(4)));
unsigned long eip;
unsigned short cs;
unsigned long eflags;
// May or may not be filled depending on privilege level of caller
unsigned long user_esp;
unsigned short user_ss __attribute__((aligned(4)));
} ISR_Stack_Frame;
char getcc( int echo );
int gethex( unsigned long *num, int digits, int echo );
void idt_install();
void idt_set_gate( unsigned char num, void ( *handler )( unsigned char num, ISR_Stack_Frame isf ), unsigned short selector, unsigned char type );
char lowercase( char c );
char uppercase( char c );
char* lowercase_str(char* input);
char* uppercase_str(char* input);
void putcc( char c );
void printhex( unsigned long num, int digits );
void printss( char *s );
void printsss( char *s, int n );
void putstring(char * str);
void _printInt(int val, int base);
void _printf(char * fmt, ...);
#endif