Merge branch 'main' into thread.asm_change
This commit is contained in:
@ -3,6 +3,7 @@ Makefile
|
|||||||
- Added the -std=c++17 flag to enable better constexpr support.
|
- Added the -std=c++17 flag to enable better constexpr support.
|
||||||
- Removed optimizations as the system would crash with them.
|
- Removed optimizations as the system would crash with them.
|
||||||
The BlueScreen would show an empty callstack on crashes with -O2 so I guess the problem is the missing ebp or something like that.
|
The BlueScreen would show an empty callstack on crashes with -O2 so I guess the problem is the missing ebp or something like that.
|
||||||
|
- Added qemu-stdio target for easy access to the serial output
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
======================================
|
======================================
|
||||||
@ -31,5 +32,7 @@ Additions
|
|||||||
Bugs
|
Bugs
|
||||||
======================================
|
======================================
|
||||||
- Can't exit the PCSPKdemo (bluescreen)
|
- Can't exit the PCSPKdemo (bluescreen)
|
||||||
|
- After exiting the VBEdemo the paging isn't reactivated (so the pagefault bluescreen no longer works)
|
||||||
|
- The PreemptiveThreadDemo LoopThreads can't be exited, the demo can't be launched multiple times
|
||||||
- Random bluescreens that are hard to pinpoint
|
- Random bluescreens that are hard to pinpoint
|
||||||
- Tree Allocator (uses a red black tree to find best-fit blocks) crashes when freelist root is removed
|
- Tree Allocator (uses a red black tree to find best-fit blocks) crashes when freelist root is removed
|
||||||
|
|||||||
@ -78,14 +78,14 @@ EMPTY :=
|
|||||||
GCC = gcc
|
GCC = gcc
|
||||||
ifeq ($(CXX),$(GCC))
|
ifeq ($(CXX),$(GCC))
|
||||||
# Separate these as they are not compatible with clang14
|
# Separate these as they are not compatible with clang14
|
||||||
EXTRAFLAGS = -mmanual-endbr -mpreferred-stack-boundary=2
|
GCCFLAGS = -mmanual-endbr -mpreferred-stack-boundary=2
|
||||||
else
|
else
|
||||||
EXTRAFLAGS = $(EMPTY)
|
GCCFLAGS = $(EMPTY)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# NOTE: Need -O0 to allow paging/bluescreen to work (We need the ebp on the stack)
|
# NOTE: Need -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 -Wno-write-strings -mno-sse -mno-sse2 $(EXTRAFLAGS)
|
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 $(GCCFLAGS)
|
||||||
|
|
||||||
# NOTE: -std=c++17 for if constexpr and probably some other stuff
|
# NOTE: -std=c++17 for if constexpr and probably some other stuff
|
||||||
# -std=c++20 is needed for template concepts and optional references, but we don't have it available :(
|
# -std=c++20 is needed for template concepts and optional references, but we don't have it available :(
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
* Aenderungen von Michael Schoettner, HHU, 21.8.2016 *
|
* Aenderungen von Michael Schoettner, HHU, 21.8.2016 *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#include "devices/CGA.h"
|
#include "devices/CGA.h"
|
||||||
#include "user/lib/MyLib.h"
|
#include "user/lib/Memory.h"
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Methode: CGA::setpos *
|
* Methode: CGA::setpos *
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public:
|
|||||||
void outb(unsigned char offset, unsigned char val) const {
|
void outb(unsigned char offset, unsigned char val) const {
|
||||||
asm volatile("outb %0, %1"
|
asm volatile("outb %0, %1"
|
||||||
:
|
:
|
||||||
: "a"(val), "Nd"(address + offset));
|
: "a"(val), "Nd"((unsigned short)(address + offset)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wortweise Ausgabe eines Wertes ueber einen I/O-Port.
|
// Wortweise Ausgabe eines Wertes ueber einen I/O-Port.
|
||||||
@ -70,7 +70,7 @@ public:
|
|||||||
|
|
||||||
asm volatile("inb %1, %0"
|
asm volatile("inb %1, %0"
|
||||||
: "=a"(ret)
|
: "=a"(ret)
|
||||||
: "Nd"(address + offset));
|
: "Nd"((unsigned short)(address + offset)));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ void Thread_init(unsigned int* esp, unsigned int* stack, void (*kickoff)(Thread*
|
|||||||
|
|
||||||
// NOTE: c++17 doesn't allow register
|
// NOTE: c++17 doesn't allow register
|
||||||
// register unsigned int** sp = (unsigned int**)stack;
|
// register unsigned int** sp = (unsigned int**)stack;
|
||||||
|
unsigned int** sp = (unsigned int**)stack;
|
||||||
|
|
||||||
// Stack initialisieren. Es soll so aussehen, als waere soeben die
|
// Stack initialisieren. Es soll so aussehen, als waere soeben die
|
||||||
// eine Funktion aufgerufen worden, die als Parameter den Zeiger
|
// eine Funktion aufgerufen worden, die als Parameter den Zeiger
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#ifndef __Iterator_Include_H_
|
#ifndef __Iterator_Include_H_
|
||||||
#define __Iterator_Include_H_
|
#define __Iterator_Include_H_
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
|
|
||||||
namespace bse {
|
namespace bse {
|
||||||
|
|
||||||
// This iterator works for structures where the elements are adjacent in memory.
|
// This iterator works for structures where the elements are adjacent in memory.
|
||||||
@ -30,11 +28,11 @@ namespace bse {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContinuousIterator operator+(std::size_t add) {
|
ContinuousIterator operator+(unsigned int add) {
|
||||||
return ContinuousIterator(this->ptr + add);
|
return ContinuousIterator(this->ptr + add);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContinuousIterator operator-(std::size_t sub) {
|
ContinuousIterator operator-(unsigned int sub) {
|
||||||
return ContinuousIterator(this->ptr - sub);
|
return ContinuousIterator(this->ptr - sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,11 +50,11 @@ namespace bse {
|
|||||||
bool operator!=(const ContinuousIterator& other) const { return this->ptr != other.ptr; }
|
bool operator!=(const ContinuousIterator& other) const { return this->ptr != other.ptr; }
|
||||||
|
|
||||||
template<typename t>
|
template<typename t>
|
||||||
friend std::size_t distance(const ContinuousIterator<t>& first, const ContinuousIterator<t>& last);
|
friend unsigned int distance(const ContinuousIterator<t>& first, const ContinuousIterator<t>& last);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::size_t distance(const ContinuousIterator<T>& first, const ContinuousIterator<T>& last) {
|
unsigned int distance(const ContinuousIterator<T>& first, const ContinuousIterator<T>& last) {
|
||||||
return last.ptr - first.ptr;
|
return last.ptr - first.ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "user/lib/MyLib.h"
|
#include "user/lib/Memory.h"
|
||||||
|
|
||||||
void bse::memset(char* destination, char value, unsigned int bytes) {
|
void bse::memset(char* destination, char value, unsigned int bytes) {
|
||||||
for (unsigned int byte = 0; byte < bytes; ++byte) {
|
for (unsigned int byte = 0; byte < bytes; ++byte) {
|
||||||
@ -2,6 +2,7 @@
|
|||||||
#define __MYSTDLIB_INCLUDE_H_
|
#define __MYSTDLIB_INCLUDE_H_
|
||||||
|
|
||||||
namespace bse {
|
namespace bse {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void memcpy(T* destination, T* source, unsigned int count = 1) {
|
void memcpy(T* destination, T* source, unsigned int count = 1) {
|
||||||
for (unsigned int i = 0; i < count; ++i) {
|
for (unsigned int i = 0; i < count; ++i) {
|
||||||
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include "Iterator.h"
|
#include "Iterator.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include <cstddef>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
// https://en.cppreference.com/w/cpp/container/vector
|
// https://en.cppreference.com/w/cpp/container/vector
|
||||||
|
|||||||
BIN
tools/build
BIN
tools/build
Binary file not shown.
Reference in New Issue
Block a user