removed some more useless code
This commit is contained in:
parent
9c221fca53
commit
1313377328
10 changed files with 0 additions and 63716 deletions
|
@ -1,2 +0,0 @@
|
|||
cp build/kernel/kernel iso
|
||||
grub-mkrescue -o bootable.iso iso
|
76
do_all.sh
76
do_all.sh
|
@ -1,76 +0,0 @@
|
|||
unset CFLAGS CXXFLAGS LDFLAGS
|
||||
builddir() {
|
||||
rm -rf build/ &&
|
||||
mkdir -pv build/
|
||||
}
|
||||
rm -rvvf out/
|
||||
mkdir -pv out/
|
||||
#x86-PC config
|
||||
{
|
||||
echo 0 #x86-pc
|
||||
yes ''
|
||||
} | ./config.py &&
|
||||
builddir &&
|
||||
pushd build &&
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/i686-elf.cmake .. &&
|
||||
make -j$(nproc) &&
|
||||
popd &&
|
||||
buildtools/grub-iso.sh &&
|
||||
mv bootable.iso out/x86-pc.iso &&
|
||||
cp build/kernel/kernel out/x86-pc.elf
|
||||
|
||||
#x86-PC config
|
||||
{
|
||||
echo 1 #x86_64-pc
|
||||
yes ''
|
||||
} | ./config.py &&
|
||||
builddir &&
|
||||
pushd build &&
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/x86_64-elf.cmake .. &&
|
||||
make -j$(nproc) &&
|
||||
popd &&
|
||||
buildtools/grub-iso.sh &&
|
||||
mv bootable.iso out/x86_64-pc.iso &&
|
||||
cp build/kernel/kernel out/x86_64-pc.elf
|
||||
|
||||
#arm-3ds9 config
|
||||
{
|
||||
echo 2 #arm
|
||||
echo 0 #3ds9
|
||||
yes ''
|
||||
} | ./config.py &&
|
||||
builddir &&
|
||||
pushd build &&
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-none-eabi.cmake .. &&
|
||||
make -j$(nproc) &&
|
||||
popd &&
|
||||
mv build/kernel/kernel kernel9 &&
|
||||
cp -v kernel9 out/arm9loaderhax.elf
|
||||
|
||||
#arm-3ds11 config
|
||||
{
|
||||
echo 2 #arm
|
||||
echo 1 #3ds11
|
||||
yes ''
|
||||
} | ./config.py &&
|
||||
builddir &&
|
||||
pushd build &&
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-none-eabi.cmake .. &&
|
||||
make -j$(nproc) &&
|
||||
popd &&
|
||||
mv kernel9 build/kernel &&
|
||||
buildtools/sighax-firm.sh &&
|
||||
mv sighax.firm out/ &&
|
||||
cp -v build/kernel/kernel out/arm11loaderhax.elf
|
||||
|
||||
{
|
||||
echo 2
|
||||
echo 2
|
||||
yes ''
|
||||
} | ./config.py &&
|
||||
builddir &&
|
||||
pushd build &&
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-none-eabi.cmake .. &&
|
||||
make -j$(nproc) &&
|
||||
popd &&
|
||||
cp -v build/kernel/kernel out/raspi2.elf
|
|
@ -1,44 +0,0 @@
|
|||
## Syscall list
|
||||
This list is not complete, but the numbers and the arguments are most likely final
|
||||
|
||||
- `exit(int)`
|
||||
- `void *mmap(void *addr, size_t length, int prot)`
|
||||
- `void munmap(void *addr, size_t length)`
|
||||
- `void closeHandle(void *handle)`
|
||||
- `void *duplicateHandle(void *handle)`
|
||||
- `void *createService(char name[16], int maxSessions)`
|
||||
- `void *connectToService(char name[16])`
|
||||
- `void *replyAndReceive(int * handleEventOut, void ** handles, int handleCount, uint8_t data[256])` - returns a handle if there is a new connection or if a handle has closed the connection
|
||||
- `void *create_shared(void **handle_out, void* addr, size_t length, int prot, void *tgt_process)` - returns a handle for the other process to map shared memory
|
||||
- `void *mmap_shared(void* handle, void* addr)`
|
||||
- `int fork()`
|
||||
- `int vfork()` - Used for threading
|
||||
- `int getpid()`
|
||||
- `int getppid()`
|
||||
- `int setppid()`
|
||||
|
||||
## Example code
|
||||
Bare-metal (no libc) hello world
|
||||
|
||||
int main() {
|
||||
auto tty_handle = connectToService("tty:u");
|
||||
if(!tty_handle)
|
||||
exit(1);
|
||||
union {
|
||||
struct {
|
||||
int cmd_id;
|
||||
char text[252];
|
||||
}__attribute__((packed))
|
||||
uint8_t data[256];
|
||||
} cmdbuf;
|
||||
cmdbuf.cmd_id = 1; //1 == puts()
|
||||
const char* s = "Hello, World!";
|
||||
int i;
|
||||
for(i=0;s[i];i++)
|
||||
cmdbuf.text[i]=s[i];
|
||||
cmdbuf.text[i]=0;
|
||||
replyAndReceive(nullptr, &tty_handle, 1, cmdbuf.data); //Passing nullptr to handleEventOut will not wrote a event handle number
|
||||
closeHandle(tty_handle);
|
||||
exit(1);
|
||||
}
|
||||
|
60
fontgen.py
60
fontgen.py
|
@ -1,60 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Generates a kernel/src/include/genfont.h from stdin
|
||||
"""
|
||||
|
||||
import binascii
|
||||
import sys
|
||||
f = open("kernel/src/include/genfont.h", "w")
|
||||
f.write("//Generated by fontgen.py\n")
|
||||
lines = sys.stdin.readlines()
|
||||
font = {}
|
||||
#font -> unicode, font pair
|
||||
print("Parsing")
|
||||
for l in lines:
|
||||
font[int.from_bytes(binascii.unhexlify(
|
||||
l[:4]), byteorder="big")] = binascii.unhexlify(l[5:-1])
|
||||
|
||||
|
||||
fontbytes = bytearray()
|
||||
widths = []
|
||||
offs = []
|
||||
|
||||
for i in range(65536):
|
||||
if not i in font:
|
||||
widths.append(0)
|
||||
offs.append(None)
|
||||
else:
|
||||
fo = font[i]
|
||||
widths.append(len(fo)//2)
|
||||
offs.append(len(fontbytes))
|
||||
fontbytes += font[i]
|
||||
print("Writing")
|
||||
f.write("char font_widths[] = {\n")
|
||||
for i,width in enumerate(widths):
|
||||
if not i % 32:
|
||||
f.write(" ")
|
||||
f.write(str(width)+",")
|
||||
if i % 32 == 31:
|
||||
f.write("\n")
|
||||
f.write("};\n")
|
||||
f.write("char font_data[] = {\n")
|
||||
for i,c in enumerate(fontbytes):
|
||||
if not i % 32:
|
||||
f.write(" ")
|
||||
f.write(hex(c)+", ")
|
||||
if i % 32 == 31:
|
||||
f.write("\n")
|
||||
f.write("\n};\n")
|
||||
f.write("char *font_ptr[] = {\n")
|
||||
for i,off in enumerate(offs):
|
||||
if not i % 8:
|
||||
f.write(" ")
|
||||
if off is None:
|
||||
f.write("0,")
|
||||
else:
|
||||
f.write("&(font_data["+hex(off)+"]),")
|
||||
if i % 8 == 7:
|
||||
f.write("\n")
|
||||
f.write("};")
|
||||
print("done.")
|
|
@ -1,3 +0,0 @@
|
|||
menuentry "MTGos" {
|
||||
multiboot /kernel
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
DEVICETYPE CONSOLE
|
||||
DEVICENAME 3DS11
|
||||
CPUARCH ARM
|
||||
ENDIAN LITTLE
|
||||
BITS 32
|
||||
REGION 0x00000000 0x00010000 RX
|
||||
REGION 0x10000000 0x18000000 RW
|
||||
REGION 0x18000000 0x18600000 RW
|
||||
REGION 0x1FF00000 0x1FF80000 RW
|
||||
REGION 0x1FF80000 0x20000000 RW
|
||||
REGION 0x20000000 0x28000000 RWX
|
|
@ -1,6 +0,0 @@
|
|||
DEVICETYPE EMBEDDED
|
||||
DEVICENAME RASPI2
|
||||
CPUARCH ARM
|
||||
ENDIAN LITTLE
|
||||
BITS 32
|
||||
REGION 0x00000000 0x40000000 RWX
|
|
@ -1,14 +0,0 @@
|
|||
INCLUDE(CMakeForceCompiler)
|
||||
SET(CMAKE_SYSTEM_NAME Generic)
|
||||
SET(CMAKE_SYSTEM_VERSION 0)
|
||||
#CMAKE_FORCE_C_COMPILER($ENV{HOME}/opt/bin/i686-elf-gcc GNU)
|
||||
SET(CMAKE_C_COMPILER $ENV{HOME}/opt/bin/i686-elf-gcc)
|
||||
#CMAKE_FORCE_CXX_COMPILER($ENV{HOME}/opt/bin/i686-elf-g++ GNU)
|
||||
SET(CMAKE_CXX_COMPILER $ENV{HOME}/opt/bin/i686-elf-g++)
|
||||
SET(CMAKE_ASM_COMPILER $ENV{HOME}/opt/bin/i686-elf-gcc)
|
||||
SET(CMAKE_FIND_ROOT_PATH $ENV{HOME}/opt)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
list(APPEND CMAKE_MODULE_PATH .)
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
|
@ -1,14 +0,0 @@
|
|||
INCLUDE(CMakeForceCompiler)
|
||||
SET(CMAKE_SYSTEM_NAME Generic)
|
||||
SET(CMAKE_SYSTEM_VERSION 0)
|
||||
#CMAKE_FORCE_C_COMPILER($ENV{HOME}/opt/bin/i686-elf-gcc GNU)
|
||||
SET(CMAKE_C_COMPILER $ENV{HOME}/opt/bin/x86_64-elf-gcc)
|
||||
#CMAKE_FORCE_CXX_COMPILER($ENV{HOME}/opt/bin/i686-elf-g++ GNU)
|
||||
SET(CMAKE_CXX_COMPILER $ENV{HOME}/opt/bin/x86_64-elf-g++)
|
||||
SET(CMAKE_ASM_COMPILER $ENV{HOME}/opt/bin/x86_64-elf-gcc)
|
||||
SET(CMAKE_FIND_ROOT_PATH $ENV{HOME}/opt)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
list(APPEND CMAKE_MODULE_PATH .)
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
63486
unifont.hex
63486
unifont.hex
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue