OOStuBS - Technische Informatik II (TI-II)  2.4
task1.h
gehe zur Dokumentation dieser Datei
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2  * Technische Informatik II *
3  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4  * *
5  * T A S K 1 *
6  * *
7 \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8 
9 #ifndef __task1_header__
10 #define __task1_header__
11 
12 #include "machine/multiboot.h"
13 #include "user/appl.h"
14 #include "stdint.h"
15 
35 class Task1 : public Application{
36  private:
38  enum Flags{
39  memSize=1<<0,
40  bootDev=1<<1,
41  cmdLine=1<<2,
42  modules=1<<3,
43  aOut=1<<4,
44  elf=1<<5,
45  memMap=1<<6
46  };
47 
48 
51  uint32_t tabsize;
52  uint32_t strsize;
53  uint32_t addr;
54  uint32_t reserved;
55  };
56 
59  uint32_t num;
60  uint32_t size;
61  uint32_t addr;
62  uint32_t shndx;
63  };
64 
66  struct Module{
67  uint32_t mod_start;
68  uint32_t mod_end;
69  uint32_t string;
70  uint32_t reserved;
71  };
72 
77  struct Memory_Map{
78  uint32_t size;
79  uint32_t base_addr_low;
80  uint32_t base_addr_high;
81  uint32_t length_low;
82  uint32_t length_high;
83  uint32_t type;
84  };
85 
86  public:
89  uint32_t flags;
90  uint32_t mem_lower;
91  uint32_t mem_upper;
92  uint32_t boot_device;
93  uint32_t cmdline;
94  uint32_t mods_count;
95  uint32_t mods_addr;
96  union{
100  uint32_t mmap_length;
101  uint32_t mmap_addr;
102  };
103 
104  private:
105 
107  uint32_t magic;
108 
111 
117  bool checkFlag(Flags flag);
118 
120  void parseAndPrint();
121 
123  void testKout();
124 
126  void testKeyboard();
127 
128  public:
133  virtual void action();
134 
140  void setup(uint32_t magic, const ::Multiboot_Info* mbi);
141 };
142 
143 #endif