reformat
This commit is contained in:
@ -72,7 +72,7 @@ CC ?= gcc
|
|||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
|
|
||||||
# I added O0 to allow paging/bluescreen to work (We need the ebp on the stack)
|
# I added O0 to allow paging/bluescreen to work (We need the ebp on the stack)
|
||||||
CFLAGS := $(CFLAGS) -O0 -m32 -march=i486 -Wall -fno-stack-protector -nostdlib -I. -g -ffreestanding -fno-pie -fno-pic -mpreferred-stack-boundary=2 -Wno-write-strings -mno-sse -mno-sse2 -mmanual-endbr
|
CFLAGS := $(CFLAGS) -O0 -m32 -march=i486 -Wall -fno-stack-protector -nostdlib -I. -g -ffreestanding -fno-pie -fno-pic -Wno-write-strings -mno-sse -mno-sse2 -mmanual-endbr -mpreferred-stack-boundary=2
|
||||||
|
|
||||||
# I added -std=c++17 for if constexpr, but it isn't necessary for anything critical
|
# I added -std=c++17 for if constexpr, but it isn't necessary for anything critical
|
||||||
# Needed for template concepts, but we don't have it available: -std=c++20
|
# Needed for template concepts, but we don't have it available: -std=c++20
|
||||||
|
|||||||
@ -11,17 +11,20 @@
|
|||||||
#include "kernel/Globals.h"
|
#include "kernel/Globals.h"
|
||||||
|
|
||||||
CPU cpu; // CPU-spezifische Funktionen
|
CPU cpu; // CPU-spezifische Funktionen
|
||||||
PCSPK pcspk; // PC-Lautsprecher
|
|
||||||
CGA_Stream kout; // Ausgabe-Strom fuer Kernel
|
CGA_Stream kout; // Ausgabe-Strom fuer Kernel
|
||||||
Keyboard kb; // Tastatur
|
BIOS bios; // Schnittstelle zum 16-Bit BIOS
|
||||||
IntDispatcher intdis; // Unterbrechungsverteilung
|
VESA vesa; // VESA-Treiber
|
||||||
|
|
||||||
PIC pic; // Interrupt-Controller
|
PIC pic; // Interrupt-Controller
|
||||||
unsigned int total_mem; // RAM total
|
IntDispatcher intdis; // Unterbrechungsverteilung
|
||||||
unsigned long systime = 0;
|
PIT pit(10000);
|
||||||
|
Keyboard kb; // Tastatur
|
||||||
|
PCSPK pcspk; // PC-Lautsprecher
|
||||||
|
|
||||||
// BumpAllocator allocator;
|
// BumpAllocator allocator;
|
||||||
// LinkedListAllocator allocator;
|
// LinkedListAllocator allocator;
|
||||||
TreeAllocator allocator;
|
TreeAllocator allocator;
|
||||||
Scheduler scheduler;
|
Scheduler scheduler;
|
||||||
BIOS bios; // Schnittstelle zum 16-Bit BIOS
|
|
||||||
VESA vesa; // VESA-Treiber
|
unsigned int total_mem; // RAM total
|
||||||
PIT pit(10000);
|
unsigned long systime = 0;
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
#include "devices/CGA_Stream.h"
|
#include "devices/CGA_Stream.h"
|
||||||
#include "devices/Keyboard.h"
|
#include "devices/Keyboard.h"
|
||||||
#include "devices/PCSPK.h"
|
#include "devices/PCSPK.h"
|
||||||
|
#include "devices/PIT.h"
|
||||||
#include "devices/VESA.h"
|
#include "devices/VESA.h"
|
||||||
#include "kernel/allocator/BumpAllocator.h"
|
#include "kernel/allocator/BumpAllocator.h"
|
||||||
#include "kernel/allocator/LinkedListAllocator.h"
|
#include "kernel/allocator/LinkedListAllocator.h"
|
||||||
@ -22,24 +23,26 @@
|
|||||||
#include "kernel/interrupts/IntDispatcher.h"
|
#include "kernel/interrupts/IntDispatcher.h"
|
||||||
#include "kernel/interrupts/PIC.h"
|
#include "kernel/interrupts/PIC.h"
|
||||||
#include "kernel/threads/Scheduler.h"
|
#include "kernel/threads/Scheduler.h"
|
||||||
#include "devices/PIT.h"
|
|
||||||
|
|
||||||
extern CPU cpu; // CPU-spezifische Funktionen
|
extern CPU cpu; // CPU-spezifische Funktionen
|
||||||
extern PCSPK pcspk; // PC-Lautsprecher
|
|
||||||
extern CGA_Stream kout; // Ausgabe-Strom fuer Kernel
|
extern CGA_Stream kout; // Ausgabe-Strom fuer Kernel
|
||||||
extern Keyboard kb; // Tastatur
|
extern BIOS bios; // Schnittstelle zum 16-Bit BIOS
|
||||||
extern IntDispatcher intdis; // Unterbrechungsverteilung
|
extern VESA vesa; // VESA-Treiber
|
||||||
|
|
||||||
extern PIC pic; // Interrupt-Controller
|
extern PIC pic; // Interrupt-Controller
|
||||||
|
extern IntDispatcher intdis; // Unterbrechungsverteilung
|
||||||
extern PIT pit; // Zeitgeber
|
extern PIT pit; // Zeitgeber
|
||||||
extern unsigned int total_mem; // RAM total
|
extern Keyboard kb; // Tastatur
|
||||||
extern unsigned long systime; // wird all 10ms hochgezaehlt
|
extern PCSPK pcspk; // PC-Lautsprecher
|
||||||
|
|
||||||
// extern BumpAllocator allocator;
|
// extern BumpAllocator allocator;
|
||||||
// extern LinkedListAllocator allocator;
|
// extern LinkedListAllocator allocator;
|
||||||
extern TreeAllocator allocator;
|
extern TreeAllocator allocator;
|
||||||
extern Scheduler scheduler;
|
extern Scheduler scheduler;
|
||||||
extern BIOS bios; // Schnittstelle zum 16-Bit BIOS
|
|
||||||
extern VESA vesa; // VESA-Treiber
|
|
||||||
|
|
||||||
constexpr bool DEBUG = true;
|
constexpr bool DEBUG = true;
|
||||||
|
|
||||||
|
extern unsigned int total_mem; // RAM total
|
||||||
|
extern unsigned long systime; // wird all 10ms hochgezaehlt
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -52,7 +52,6 @@ public:
|
|||||||
// CPU freiwillig abgeben und Auswahl des naechsten Threads
|
// CPU freiwillig abgeben und Auswahl des naechsten Threads
|
||||||
void yield();
|
void yield();
|
||||||
|
|
||||||
|
|
||||||
// Thread umschalten; wird aus der ISR des PITs gerufen
|
// Thread umschalten; wird aus der ISR des PITs gerufen
|
||||||
void preempt();
|
void preempt();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,9 +15,9 @@
|
|||||||
#include "kernel/threads/IdleThread.h"
|
#include "kernel/threads/IdleThread.h"
|
||||||
#include "user/CoopThreadDemo.h"
|
#include "user/CoopThreadDemo.h"
|
||||||
#include "user/HelloWorldThread.h"
|
#include "user/HelloWorldThread.h"
|
||||||
#include "user/VBEdemo.h"
|
|
||||||
#include "user/PCSPKdemo.h"
|
#include "user/PCSPKdemo.h"
|
||||||
#include "user/PreemptiveThreadDemo.h"
|
#include "user/PreemptiveThreadDemo.h"
|
||||||
|
#include "user/VBEdemo.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
kout.clear();
|
kout.clear();
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
#ifndef __pre_loopthread_include__
|
#ifndef __pre_loopthread_include__
|
||||||
#define __pre_loopthread_include__
|
#define __pre_loopthread_include__
|
||||||
|
|
||||||
#include "kernel/threads/Thread.h"
|
|
||||||
#include "kernel/Globals.h"
|
#include "kernel/Globals.h"
|
||||||
|
#include "kernel/threads/Thread.h"
|
||||||
|
|
||||||
class PreemptiveLoopThread : public Thread {
|
class PreemptiveLoopThread : public Thread {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user