1

merged cleanup

This commit is contained in:
2022-07-24 21:12:31 +02:00
parent 5ff3d72bfd
commit 6481bae5f6
92 changed files with 663 additions and 755 deletions

View File

@ -9,7 +9,6 @@
* *
* Autor: Michael Schoettner, 11.12.2018 *
*****************************************************************************/
#include "devices/CGA.h"
#include "kernel/Globals.h"
// in startup.asm
@ -68,11 +67,11 @@ int bs_ypos = 0;
void bs_clear() {
unsigned int x;
unsigned int y;
unsigned short* ptr = (unsigned short*)0xb8000;
unsigned short* ptr = reinterpret_cast<unsigned short*>(0xb8000);
for (x = 0; x < 80; x++) {
for (y = 0; y < 25; y++) {
*(ptr + y * 80 + x) = (short)0x1F00;
*(ptr + y * 80 + x) = static_cast<short>(0x1F00);
}
}
@ -96,7 +95,7 @@ void bs_lf() {
* Beschreibung: Ein Zeichen ausgeben. *
*****************************************************************************/
void bs_print_char(char c) {
unsigned char* ptr = (unsigned char*)0xb8000;
unsigned char* ptr = reinterpret_cast<unsigned char*>(0xb8000);
*(ptr + bs_ypos * 80 * 2 + bs_xpos * 2) = c;
bs_xpos++;
@ -122,9 +121,9 @@ void bs_print_string(char* str) {
*****************************************************************************/
void bs_printHexDigit(int c) {
if (c < 10) {
bs_print_char('0' + (unsigned char)c);
bs_print_char('0' + static_cast<unsigned char>(c));
} else {
bs_print_char('A' + (unsigned char)(c - 10));
bs_print_char('A' + static_cast<unsigned char>(c - 10));
}
}
@ -145,7 +144,7 @@ void bs_print_uintHex(unsigned int c) {
* Beschreibung: String mit Integer ausgeben. Wird verwendet um ein *
* Register auszugeben. *
*****************************************************************************/
void bs_printReg(char* str, int value) {
void bs_printReg(char* str, unsigned int value) {
bs_print_string(str);
bs_print_uintHex(value);
bs_print_string(" \0");
@ -211,7 +210,7 @@ void bs_dump(unsigned int exceptionNr) {
get_int_esp(&int_esp);
// wir müssen den Inhalt auslesen und das als Zeiger verwenden, um den Stack auszulesen
sptr = (unsigned int*)*int_esp;
sptr = reinterpret_cast<unsigned int*>(*int_esp);
bs_lf();
@ -252,7 +251,7 @@ void bs_dump(unsigned int exceptionNr) {
// Exception mit Error-Code?
if (has_error_code == 1) {
int error_nr = *(sptr + 8);
unsigned int error_nr = *(sptr + 8);
if (exceptionNr == 14) {
if (error_nr == 3) {
@ -278,7 +277,7 @@ void bs_dump(unsigned int exceptionNr) {
bs_print_string("Calling Stack:\0");
bs_lf();
int x = 0;
unsigned int* ebp = (unsigned int*)*(sptr + 2);
unsigned int* ebp = reinterpret_cast<unsigned int*>(*(sptr + 2));
unsigned int raddr;
// solange eip > 1 MB && ebp < 128 MB, max. Aufruftiefe 10
@ -289,7 +288,7 @@ void bs_dump(unsigned int exceptionNr) {
bs_lf();
// dynamische Kette -> zum Aufrufer
ebp = (unsigned int*)*ebp;
ebp = reinterpret_cast<unsigned int*>(*ebp);
x++;
}

View File

@ -10,8 +10,8 @@
* Autor: Michael Schoettner, 2.2.2017 *
*****************************************************************************/
#ifndef __Bluescreen_include__
#define __Bluescreen_include__
#ifndef Bluescreen_include__
#define Bluescreen_include__
// dump blue screen (will not return)
void bs_dump(unsigned int exceptionNr);

View File

@ -9,16 +9,16 @@
* *
* Autor: Michael Schoettner, 06.04.20 *
*****************************************************************************/
#ifndef __ISR_include__
#define __ISR_include__
#ifndef ISR_include__
#define ISR_include__
class ISR {
private:
public:
ISR(const ISR& copy) = delete; // Verhindere Kopieren
public:
ISR() {}
// virtual ~ISR() = default;
ISR() = default;
// Unterbrechungsbehandlungsroutine
virtual void trigger() = 0;

View File

@ -15,7 +15,7 @@
#include "kernel/Globals.h"
#include "kernel/interrupts/Bluescreen.h"
extern "C" void int_disp(unsigned int slot);
extern "C" void int_disp(unsigned int vector);
/*****************************************************************************
* Prozedur: int_disp *
@ -60,12 +60,12 @@ int IntDispatcher::assign(unsigned int vector, ISR& isr) {
/* hier muss Code eingefuegt werden */
if (vector >= this->size) {
if (vector >= size) {
log.error() << "Invalid vector number when assigning" << endl;
return -1;
}
this->map[vector] = &isr;
map[vector] = &isr;
log.info() << "Registered ISR for vector " << dec << vector << endl;
return 0;
@ -85,11 +85,11 @@ int IntDispatcher::report(unsigned int vector) {
/* hier muss Code eingefuegt werden */
if (vector >= this->size) {
if (vector >= size) {
return -1;
}
ISR* isr = this->map[vector];
ISR* isr = map[vector];
if (isr == nullptr) {
log.error() << "No ISR registered for vector " << vector << endl;

View File

@ -10,18 +10,19 @@
* *
* Autor: Michael Schoettner, 30.7.16 *
*****************************************************************************/
#ifndef __IntDispatcher_include__
#define __IntDispatcher_include__
#ifndef IntDispatcher_include__
#define IntDispatcher_include__
#include "kernel/interrupts/ISR.h"
#include "user/lib/Logger.h"
#include "user/lib/Array.h"
class IntDispatcher {
private:
NamedLogger log;
enum { size = 256 };
ISR* map[size];
bse::array<ISR*, size> map;
public:
IntDispatcher(const IntDispatcher& copy) = delete; // Verhindere Kopieren

View File

@ -14,8 +14,8 @@
* *
* Autor: Olaf Spinczyk, TU Dortmund *
*****************************************************************************/
#ifndef __PIC_include__
#define __PIC_include__
#ifndef PIC_include__
#define PIC_include__
#include "kernel/IOport.h"