Rev 4349 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | |
2 | #define __KOS_IO_H__ |
||
3 | |||
4 | |||
5 | typedef struct |
||
6 | { |
||
7 | char sec; |
||
8 | char min; |
||
9 | char hour; |
||
10 | char rsv; |
||
11 | }detime_t; |
||
12 | |||
13 | |||
14 | { |
||
15 | char day; |
||
16 | char month; |
||
17 | short year; |
||
18 | }dedate_t; |
||
19 | |||
20 | |||
21 | { |
||
22 | unsigned attr; |
||
23 | unsigned flags; |
||
24 | union |
||
25 | { |
||
26 | detime_t ctime; |
||
27 | unsigned cr_time; |
||
28 | }; |
||
29 | union |
||
30 | { |
||
31 | dedate_t cdate; |
||
32 | unsigned cr_date; |
||
33 | }; |
||
34 | union |
||
35 | { |
||
36 | detime_t atime; |
||
37 | unsigned acc_time; |
||
38 | }; |
||
39 | union |
||
40 | { |
||
41 | dedate_t adate; |
||
42 | unsigned acc_date; |
||
43 | }; |
||
44 | union |
||
45 | { |
||
46 | detime_t mtime; |
||
47 | unsigned mod_time; |
||
48 | }; |
||
49 | union |
||
50 | { |
||
51 | dedate_t mdate; |
||
52 | unsigned mod_date; |
||
53 | }; |
||
54 | unsigned size; |
||
55 | unsigned size_high; |
||
56 | } fileinfo_t; |
||
57 | |||
58 | |||
59 | |||
60 | |||
61 | int get_fileinfo(const char *path, fileinfo_t *info); |
||
62 | int read_file(const char *path, void *buff, |
||
63 | size_t offset, size_t count, size_t *reads); |
||
64 | int write_file(const char *path,const void *buff, |
||
65 | size_t offset, size_t count, size_t *writes); |
||
66 | int set_file_size(const char *path, unsigned size); |
||
67 | void *load_file(const char *path, size_t *len); |
||
68 | void unpack(void* packed_data, void* unpacked_data) __attribute__((stdcall)) ; |
||
4806 | Serge | 69 | |
4349 | Serge | 70 | |
71 | { |
||
72 | int val; |
||
73 | __asm__ __volatile__( |
||
74 | "int $0x40" |
||
75 | :"=a"(val) |
||
76 | :"a"(68),"b"(12),"c"(mem)); |
||
77 | return val; |
||
78 | } |
||
79 | |||
80 | |||
81 | { |
||
82 | __asm__ __volatile__( |
||
83 | "int $0x40" |
||
84 | ::"a"(30),"b"(1),"c"(cwd)); |
||
85 | }; |
||
86 | |||
87 | |||
88 |