-
Notifications
You must be signed in to change notification settings - Fork 0
/
FSdata.h
112 lines (96 loc) · 4.02 KB
/
FSdata.h
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// FSdata.h, file service data
#ifndef __FS_DATA_H__
#define __FS_DATA_H__
//************************** File Service Data **************************
char help_txt_data[] = {
'I', '\'', 'm', ' ', 's', 'o', 'r', 'r', 'y', ',', ' ', 'b', 'u', 't',
' ', 'm', 'y', ' ', 'c', 'a', 'p', 'a', 'c', 'i', 't', 'y', ' ', 't',
'o', ' ', 'a', 'n', 's', 'w', 'e', 'r', 'i', 'n', 'g', ' ', 'y', 'o',
'u', 'r', ' ', 'q', 'u', 'e', 's', 't', 'i', 'o', 'n', 's', ' ', 'i',
's', ' ', 'l', 'i', 'm', 'i', 't', 'e', 'd', '.', '\n', '\r', 'Y', 'o',
'u', ' ', 'm', 'u', 's', 't', ' ', 'a', 's', 'k', ' ', 't', 'h', 'e',
' ', 'r', 'i', 'g', 'h', 't', ' ', 'q', 'u', 'e', 's', 't', 'i', 'o',
'n', '.', '\n', '\r', '\0'
};
#define HELP_TXT_SIZE ( sizeof( help_txt_data ) )
char note_txt_data[] = {
'A', ' ', 'f', 'a', 'i', 'l', 'u', 'r', 'e', ' ', 'i', 's', ' ', 'o',
'f', 't', 'e', 'n', ' ', 'p', 'r', 'e', 'c', 'u', 'r', 's', 'o', 'r',
'e', 'd', ' ', 'b', 'y', ' ', '1', '0', '0', ' ', 'e', 'x', 'c', 'u',
's', 'e', 's', '.', '\n', '\r', '\0'
};
#define NOTE_TXT_SIZE ( sizeof( note_txt_data ) )
// C compiler joins lines below and adds '\0' at the end (not for char arrays above).
char index_html_data[] = {
"<HTML>\n\r"
"<HEAD>\n\r"
"<TITLE>159ers:</TITLE>\n\r"
"</HEAD>\n\r"
"<BODY>\n\r"
"The Few, the Pround. Semper fi!\n\r"
"Failure's best friend: Excuse.\n\r"
"Success, on the other hand, has only itself.\n\r"
"</BODY></HTML>\n\r"
};
#define INDEX_HTML_SIZE ( sizeof( index_html_data ) ) // null is added+counted
char hello_html_data[] = {
"<HTML><HEAD>\n\r"
"<TITLE>The Leopard and the Monkeys</TITLE>\n\r"
"</HEAD>\n\r"
"<BODY BgColor=#FFFFFF>\n\r"
"Monkeys in the jungle, they taunt and mob as a lone leopard walking by by "
"yelping and smugging. The leopard hisses back -- one last warning.\n\r"
"Monkeys just ignore it, and acerbate their intimidation.\n\r"
"The leopard strikes, in lightning speed.\n\r"
"Monkeys flees and cries. Slain and mauled.\n\r"
"Primemates live in social settings, in each other's eyes. Vanity and hot air.\n\r"
"A leopard lives only in its own eyes.\n\r"
"Be a leopard at work, get things done quickly and quietly; not fancy talks nor blame games.\n\r"
"</BODY></HTML>\n\r"
};
#define HELLO_HTML_SIZE ( sizeof( hello_html_data ) ) // null is added+counted
//phase 7
//
char sleep3[]={
#include "bin-code/sleep3.txt"
};
#define SLEEP3_SIZE (sizeof(sleep3))
char printer_msg[]={
#include "bin-code/printer_msg.txt"
};
#define PRINTER_MSG_SIZE (sizeof(printer_msg))
char PF_test[]={
#include "bin-code/PF_test.txt"
};
#define PF_TEST_SIZE (sizeof(PF_test))
// We'll define "root_dir[]" later. Here is a forward declare.
extern dir_t root_dir[]; // prototype it in advance
dir_t bin_dir[] = {
{16, MODE_DIR, 0, ".", (char *)bin_dir}, // current dir
{17, MODE_DIR, 0, "..", (char *)root_dir}, // parent dir, forward declared
{18, MODE_EXEC, SLEEP3_SIZE, "sleep3", (char *)sleep3},
{19, MODE_EXEC, PRINTER_MSG_SIZE, "printer_msg", (char *)printer_msg},
{20, MODE_EXEC, PF_TEST_SIZE, "PF_test", (char *)PF_test},
{0,0,0,NULL,NULL},
{END_INODE, 0, 0, NULL, NULL}
};
dir_t www_dir[] = {
{10, MODE_DIR, 0, ".", (char *)www_dir},
{11, MODE_DIR, 0, "..", (char *)root_dir},
{12, MODE_FILE, HELLO_HTML_SIZE, "hello.html", (char *)hello_html_data},
{13, MODE_FILE, INDEX_HTML_SIZE, "index.html", (char *)index_html_data},
{0, 0, 0, NULL, NULL},
{END_INODE, 0, 0, NULL, NULL}
};
dir_t root_dir[] = {
{1, MODE_DIR, 0, ".", (char *)root_dir},
{2, MODE_DIR, sizeof(bin_dir), "bin", (char *)bin_dir},
{3, MODE_DIR, sizeof(www_dir), "www", (char *)www_dir},
{4, MODE_FILE, HELP_TXT_SIZE, "help.txt", (char *)help_txt_data},
{5, MODE_FILE, NOTE_TXT_SIZE, "note.txt", (char *)note_txt_data},
{0, 0, 0, NULL, NULL},
{END_INODE, 0, 0, NULL, NULL}
};
fd_t fd_array[FD_NUM]; // one file descriptor for every OPEN_OBJ call
// *********************************************************************
#endif __FS_DATA_H__