Clean up folders

This commit is contained in:
Fergal Moran
2020-06-09 00:49:30 +01:00
parent 4bbb3c6d1d
commit 2a31559cd9
25 changed files with 207 additions and 153 deletions

View File

@@ -1,14 +0,0 @@
#ifndef __BLOCKMOUSEHANDLER_H
#define __BLOCKMOUSEHANDLER_H
#include "mouse.h"
#include "stdio.h"
class BlockMouseHandler : public MouseEventHandler {
private:
int8_t _screenX, _screenY;
public:
BlockMouseHandler();
virtual void OnMouseMove(int xoffset, int yoffset);
};
#endif

View File

@@ -1,10 +1,12 @@
#ifndef __STDIO_H
#define __STDIO_H
#include "types.h"
#ifndef __FERGLOS_COMMON_STDIO_H
#define __FERGLOS_COMMON_STDIO_H
#include <common/types.h>
namespace ferglos {
namespace common {
void printf(const char* str);
void wprintf(const wchar_t* str);
void printfHex(uint8_t key);
void clear();
} // namespace common
} // namespace ferglos
#endif

View File

@@ -1,14 +1,7 @@
/*
* types.h
* Author: Fergal Moran
* Copyright: 2020 Fergal Moran
*
* BSD License - do what you want
*/
#ifndef __TYPES_H
#define __TYPES_H
#ifndef __FERGLOS_COMMON_TYPES_H
#define __FERGLOS_COMMON_TYPES_H
namespace ferglos {
namespace common {
typedef char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
@@ -17,5 +10,6 @@ typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif
} // namespace common
} // namespace ferglos
#endif

View File

@@ -0,0 +1,20 @@
#ifndef __FERGLOS_DRIVERS_BLOCKMOUSEHANDLER_H
#define __FERGLOS_DRIVERS_BLOCKMOUSEHANDLER_H
#include <common/stdio.h>
#include <drivers/mouse.h>
using namespace ferglos::common;
namespace ferglos {
namespace drivers {
class BlockMouseHandler : public MouseEventHandler {
private:
int8_t _screenX, _screenY;
public:
BlockMouseHandler();
virtual void OnMouseMove(int xoffset, int yoffset);
};
} // namespace drivers
} // namespace ferglos
#endif

View File

@@ -1,5 +1,7 @@
#ifndef __DRIVER_H
#define __DRIVER_H
#ifndef __FERGLOS_DRIVERS_DRIVER_H
#define __FERGLOS_DRIVERS_DRIVER_H
namespace ferglos {
namespace drivers {
class Driver {
public:
Driver();
@@ -22,4 +24,6 @@ class DriverManager {
void ActivateAll();
};
} // namespace drivers
} // namespace ferglos
#endif

View File

@@ -0,0 +1,15 @@
#ifndef __FERGLOS_DRIVERS_ECHOKEYBOARDHANDLER_H
#define __FERGLOS_DRIVERS_ECHOKEYBOARDHANDLER_H
#include <common/stdio.h>
#include <drivers/keyboard.h>
namespace ferglos {
namespace drivers {
class EchoKeyboardHandler : public KeyboardEventHandler {
public:
virtual void OnKeyDown(const wchar_t* key);
};
} // namespace drivers
} // namespace ferglos
#endif

View File

@@ -1,10 +1,16 @@
#ifndef __KEYBOARD_H
#define __KEYBOARD_H
#ifndef __FERGLOS_DRIVERS_KEYBOARD_H
#define __FERGLOS_DRIVERS_KEYBOARD_H
#include <common/stdio.h>
#include <common/types.h>
#include <drivers/driver.h>
#include <hardware/interrupts.h>
#include <hardware/port.h>
#include "driver.h"
#include "interrupts.h"
#include "port.h"
#include "types.h"
using namespace ferglos::common;
using namespace ferglos::hardware;
namespace ferglos {
namespace drivers {
class KeyboardEventHandler {
public:
@@ -27,4 +33,6 @@ class KeyboardDriver : public InterruptHandler, public Driver {
virtual uint32_t HandleInterrupt(uint32_t esp);
virtual void Activate();
};
} // namespace drivers
} // namespace ferglos
#endif

View File

@@ -1,10 +1,15 @@
#ifndef __MOUSE_H
#define __MOUSE_H
#ifndef __FERGLOS_DRIVERS_MOUSE_H
#define __FERGLOS_DRIVERS_MOUSE_H
#include "driver.h"
#include "interrupts.h"
#include "port.h"
#include "types.h"
#include <common/types.h>
#include <drivers/driver.h>
#include <hardware/interrupts.h>
#include <hardware/port.h>
using namespace ferglos::common;
using namespace ferglos::hardware;
namespace ferglos {
namespace drivers {
class MouseEventHandler {
private:
public:
@@ -34,4 +39,6 @@ class MouseDriver : public InterruptHandler, public Driver {
virtual uint32_t HandleInterrupt(uint32_t esp);
virtual void Activate();
};
} // namespace drivers
} // namespace ferglos
#endif

View File

@@ -1,10 +0,0 @@
#ifndef __ECHOKEYBOARDHANDLER_H
#define __ECHOKEYBOARDHANDLER_H
#include "keyboard.h"
#include "stdio.h"
class EchoKeyboardHandler : public KeyboardEventHandler {
public:
virtual void OnKeyDown(const wchar_t* key);
};
#endif

View File

@@ -1,15 +1,9 @@
/*
* gdt.h
* Author: Fergal Moran
* Copyright: 2020 Fergal Moran
*
* BSD License - do what you want
*/
#ifndef __GDT_H
#define __GDT_H
#include "types.h"
#ifndef __FERGLOS_GDT_H
#define __FERGLOS_GDT_H
#include <common/types.h>
using namespace ferglos::common;
namespace ferglos {
/*
The Global Descriptor Table (GDT) is a data structure used by Intel x86-family processors
starting with the 80286 in order to define the characteristics of the various memory areas
@@ -50,5 +44,5 @@ class GlobalDescriptorTable {
uint16_t CodeSegmentSelector();
uint16_t DataSegmentSelector();
};
} // namespace ferglos
#endif

View File

@@ -1,9 +1,14 @@
#ifndef __INTERRUPTS_H
#define __INTERRUPTS_H
#include "gdt.h"
#include "port.h"
#include "types.h"
#ifndef __FERGLOS_HARDWARE_INTERRUPTS_H
#define __FERGLOS_HARDWARE_INTERRUPTS_H
#include <common/types.h>
#include <gdt.h>
#include <hardware/port.h>
using namespace ferglos::drivers;
namespace ferglos {
namespace hardware {
class InterruptManager;
class InterruptHandler {
protected:
@@ -61,7 +66,7 @@ class InterruptManager {
void Activate();
void Deactivate();
static uint32_t HandleInterrupt(uint8_t interruptNumber, uint32_t esp);
static uint32_t HandleInterrupt(uint8_t interrupt, uint32_t esp);
uint32_t DoHandleInterrupt(uint8_t interruptNumber, uint32_t esp);
static void IgnoreInterruptRequest();
@@ -69,4 +74,6 @@ class InterruptManager {
static void HandleInterruptRequest0x01();
static void HandleInterruptRequest0x0C();
};
} // namespace hardware
} // namespace ferglos
#endif

View File

@@ -1,14 +1,11 @@
/*
* port.h
* Author: Fergal Moran
* Copyright: 2020 Fergal Moran
*
* BSD License - do what you want
*/
#ifndef __PORT_H
#define __PORT_H
#ifndef __FERGLOS_HARDWARE_PORT_H
#define __FERGLOS_HARDWARE_PORT_H
#include "types.h"
#include <common/types.h>
using namespace ferglos::common;
namespace ferglos {
namespace drivers {
class Port {
protected:
@@ -51,5 +48,6 @@ class Port32Bit : public Port {
virtual void Write(uint32_t data);
virtual uint32_t Read();
};
} // namespace drivers
} // namespace ferglos
#endif