7 Commits

Author SHA1 Message Date
04b14863e5 do not strip s2 toolchain 2024-07-15 08:32:19 +02:00
78db65b84a CI: hopefully working cache? 2024-07-14 23:32:54 +02:00
53e6efa772 fixie 2024-07-14 22:50:28 +02:00
8520290a13 CI: remove build parallel 2024-07-14 22:34:25 +02:00
6c25a0b324 generic toolchain build in CI 2024-07-14 22:32:40 +02:00
a5f8b53855 remove prebuilt toolchains 2024-07-14 21:46:56 +02:00
57a636f49c tmp 2024-07-14 21:44:00 +02:00
4 changed files with 37 additions and 2 deletions

2
run.sh
View File

@@ -39,7 +39,7 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
TERM_USED=true
# monitor
# serial
QEMU_OPTS="$QEMU_OPTS -monitor stdio"
shift
;;

View File

@@ -10,6 +10,10 @@
FbTty::FbTty(Framebuffer *fb) : _fb(fb) {
_max_col = _fb->dimensions().x / 8;
_max_row = _fb->dimensions().y / 16;
_buf.resize(_max_col);
for (auto &b: _buf) {
b.resize(_max_row);
}
}
void FbTty::putchar(char c) {
if (c == '\n') {

View File

@@ -4,9 +4,10 @@
#ifndef FBTTY_HPP
#define FBTTY_HPP
#include <PS2Keyboard.hpp>
#include <Tty.hpp>
#include <Vector.hpp>
class Framebuffer;
class FbTty : public Tty {
@@ -27,6 +28,8 @@ private:
int _max_row = 0;
int _max_col = 0;
Vector<Vector<char>> _buf;
void next_col();
void next_row();

View File

@@ -146,6 +146,34 @@ public:
return out;
}
void resize(size_t size) {
if (size == _cur_size) return;
if (size < _cur_size) {
for (int i = size; i < _cur_size; i++) {
if constexpr (!std::is_trivially_destructible<T>::value)
std::destroy_at(_data + i);
}
_cur_size = size;
compact();
return;
}
if (size > _cur_size) {
if (_capacity < size) {
_capacity = size;
_data = (T *) krealloc(reinterpret_cast<char *>(_data), _capacity * sizeof(T));
}
for (int i = size; i < _cur_size; i++) {
if constexpr (!std::is_trivially_constructible<T>::value)
new (_data + i) T();
else
memset((char *) (_data + i), 0, sizeof(T));
}
return;
}
}
T *data() { return _data; }
const T *data() const { return _data; }