[WIP] Implementing "console" output and stuff.
This commit is contained in:
@@ -1,17 +1,54 @@
|
||||
Import('env')
|
||||
|
||||
def _resource(env, res, symbol):
|
||||
def _generate_s(target, source, env):
|
||||
with open(target[0].abspath, 'w') as f:
|
||||
f.write(f'''
|
||||
.section .rodata
|
||||
.global {symbol}
|
||||
.type {symbol} @object
|
||||
|
||||
.section .rodata
|
||||
.global {symbol}_SIZE
|
||||
.type {symbol}_SIZE @object
|
||||
{symbol}:
|
||||
.incbin "{res}"
|
||||
{symbol}_END:
|
||||
{symbol}_SIZE:
|
||||
.int {symbol}_END - {symbol}
|
||||
''')
|
||||
with open(target[1].abspath, 'w') as f:
|
||||
f.write(f'''
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C"
|
||||
{{
|
||||
extern const uint8_t {symbol}[];
|
||||
extern const unsigned {symbol}_SIZE;
|
||||
}}
|
||||
|
||||
''')
|
||||
env.Command([f'{res}.s', f'{res}.hpp'.replace('src/', 'include/')], res, action = _generate_s)
|
||||
env.AddMethod(_resource, 'Resource')
|
||||
|
||||
any_target_sources = Split('''
|
||||
src/app/main.cpp
|
||||
|
||||
src/libs/psf.cpp
|
||||
|
||||
src/os/draw.cpp
|
||||
src/os/panic.cpp
|
||||
src/os/tty.cpp
|
||||
src/os/resources/lat9-08.psf.s
|
||||
|
||||
src/cstdlib/assert.cpp
|
||||
src/cstdlib/stdio.cpp
|
||||
src/cstdlib/stdlib.cpp
|
||||
src/cstdlib/string.cpp
|
||||
''')
|
||||
env.Resource(env.File('src/os/resources/lat9-08.psf').abspath, 'LAT9_08')
|
||||
|
||||
env.Append(KERNEL_SOURCES = [env.File(f) for f in any_target_sources])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user