mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-28 08:07:52 +01:00
Compare commits
3 Commits
af8fb59f07
...
a08d9eb334
| Author | SHA1 | Date | |
|---|---|---|---|
| a08d9eb334 | |||
| d0105fffe2 | |||
| 318f322f2a |
4
.github/workflows/ficus.yml
vendored
4
.github/workflows/ficus.yml
vendored
@@ -95,7 +95,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
toolchain/gcc-x86_64-ficus-prefix
|
toolchain/gcc-x86_64-ficus-prefix
|
||||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ficus-toolchain/*.sh') }}-${{ hashFiles('ficus-toolchain/newlib/**/*') }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ficus-toolchain/*.sh') }}-${{ hashFiles('ficus-toolchain/newlib/**') }}
|
||||||
|
|
||||||
- if: ${{ steps.cache-toolchain-s2.outputs.cache-hit != 'true' }}
|
- if: ${{ steps.cache-toolchain-s2.outputs.cache-hit != 'true' }}
|
||||||
name: Build ficus toolchain s2
|
name: Build ficus toolchain s2
|
||||||
@@ -109,7 +109,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
toolchain/gcc-x86_64-ficus-prefix
|
toolchain/gcc-x86_64-ficus-prefix
|
||||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ficus-toolchain/*.sh') }}-${{ hashFiles('ficus-toolchain/newlib/**/*') }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ficus-toolchain/*.sh') }}-${{ hashFiles('ficus-toolchain/newlib/**') }}
|
||||||
|
|
||||||
- name: Tar the toolchain
|
- name: Tar the toolchain
|
||||||
run: cd ${{github.workspace}} && tar -czvf toolchain-ficus.tar.xz toolchain sysroot
|
run: cd ${{github.workspace}} && tar -czvf toolchain-ficus.tar.xz toolchain sysroot
|
||||||
|
|||||||
2
run.sh
2
run.sh
@@ -39,7 +39,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
TERM_USED=true
|
TERM_USED=true
|
||||||
# serial
|
# monitor
|
||||||
QEMU_OPTS="$QEMU_OPTS -monitor stdio"
|
QEMU_OPTS="$QEMU_OPTS -monitor stdio"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
FbTty::FbTty(Framebuffer *fb) : _fb(fb) {
|
FbTty::FbTty(Framebuffer *fb) : _fb(fb) {
|
||||||
_max_col = _fb->dimensions().x / 8;
|
_max_col = _fb->dimensions().x / 8;
|
||||||
_max_row = _fb->dimensions().y / 16;
|
_max_row = _fb->dimensions().y / 16;
|
||||||
|
_buf.resize(_max_col);
|
||||||
|
for (auto &b: _buf) {
|
||||||
|
b.resize(_max_row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void FbTty::putchar(char c) {
|
void FbTty::putchar(char c) {
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
|
|
||||||
#ifndef FBTTY_HPP
|
#ifndef FBTTY_HPP
|
||||||
#define FBTTY_HPP
|
#define FBTTY_HPP
|
||||||
|
|
||||||
#include <PS2Keyboard.hpp>
|
#include <PS2Keyboard.hpp>
|
||||||
#include <Tty.hpp>
|
#include <Tty.hpp>
|
||||||
|
#include <Vector.hpp>
|
||||||
|
|
||||||
class Framebuffer;
|
class Framebuffer;
|
||||||
class FbTty : public Tty {
|
class FbTty : public Tty {
|
||||||
@@ -27,6 +28,8 @@ private:
|
|||||||
int _max_row = 0;
|
int _max_row = 0;
|
||||||
int _max_col = 0;
|
int _max_col = 0;
|
||||||
|
|
||||||
|
Vector<Vector<char>> _buf;
|
||||||
|
|
||||||
void next_col();
|
void next_col();
|
||||||
void next_row();
|
void next_row();
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,34 @@ public:
|
|||||||
return out;
|
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; }
|
T *data() { return _data; }
|
||||||
const T *data() const { return _data; }
|
const T *data() const { return _data; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user