OSDN Git Service

c19fe60d3c8df4b17bfd3c3e6e443d274899c655
[vaneos/vaneosmain.git] / include / VaneOS.h~
1 /****************************************
2 *VaneOS.h
3 *Vane Operating System Common Header
4 *(C) 2014 VOSystems.
5 ****************************************/
6
7 /*INCLUDE GUARD*/
8 #ifndef VANEOS_H
9 #define VANEOS_H
10
11 #include<type.h>
12
13 #define local static
14 #define DEBUG while(getchar()!='\n')
15 void write_mem_8(int,int);
16 void farjmp(int eip,int cs);
17
18 void io_hlt(void);
19 void io_cli(void);
20 void io_sti(void);
21 void io_stihlt(void);
22 int io_in8(int port);
23 void io_out8(int port, int data);
24 int io_load_eflags(void);
25 void io_store_eflags(int eflags);
26
27 int Check_VESA(void);
28 void ScreenVGA_Graphic(void);
29
30 extern int vram_start_address;
31 extern char vmode;
32 extern short scrnX,scrnY;
33
34 void init_all(void);
35 int getmsg(int msg_num);
36 void sendmsg(int msg,int msg_num);
37
38 /*Task.S*/
39 void task_switch(void);
40 void switch_task(int src,int dst);
41 void switch_task_2();
42 void toswitch(int eax);
43
44 #define cr() putchar('\n');
45
46 #define COL8_000000             0
47 #define COL8_FF0000             1
48 #define COL8_00FF00             2
49 #define COL8_FFFF00             3
50 #define COL8_0000FF             4
51 #define COL8_FF00FF             5
52 #define COL8_00FFFF             6
53 #define COL8_FFFFFF             7
54 #define COL8_C6C6C6             8
55 #define COL8_840000             9
56 #define COL8_008400             10
57 #define COL8_848400             11
58 #define COL8_000084             12
59 #define COL8_840084             13
60 #define COL8_008484             14
61 #define COL8_848484             15
62
63 /*DEFINE COMMON*/
64 #define ADR_BOOTINFO    0x00000ff0
65 #define ADR_DISKIMG             0x00100000
66 #define FAT_DISK_PLASE  0x00020000
67 #define BPB_SECTOR              63
68 #define SECTOR_SIZE             512
69
70 #define EX_CHAR_SHORT(source)   (unsigned short)(*source++ <<8) | *source++
71
72 typedef struct
73 {
74         char bootstrap_code[3];
75         char label[8];
76         unsigned short sector_byte;
77         unsigned char clust_sector;
78         unsigned short reserved_sector;
79         unsigned char fat;
80         unsigned short root_dir_entry;
81         unsigned short sector;
82         unsigned char media_code;
83         unsigned short fat_sector;
84         unsigned short track_sector;
85         unsigned short drive_head;
86         unsigned int un_known_sector;
87         unsigned int all_sector;
88         unsigned int one_fat_sector;
89         unsigned short flag;
90         unsigned short fs_ver;
91         unsigned int root_dir_start_clust_no;
92         unsigned short fs_sys_info;
93         unsigned short back_up_sector;
94         char reserved[12];
95         unsigned char physical_drive_no;
96         char reserved2;
97         char boot_signature;
98         unsigned int volume_s_ID;
99         char volume_label[11];
100         char fs_type[8];
101 }bpb_data_t;
102
103 #endif