Skip to content

Commit

Permalink
Merge with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Apr 1, 2021
2 parents 73803ee + 19539bf commit f570335
Show file tree
Hide file tree
Showing 362 changed files with 12,167 additions and 6,866 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,44 @@
on: [push, workflow_dispatch]
name: Build Image
jobs:
build-image:
runs-on: ubuntu-20.04
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Pull Builder Image
run: docker pull toaruos/build-tools:1.8.x
- name: Run Builder
run: docker run -v ${GITHUB_WORKSPACE}:/root/toaruos -w /root/toaruos -e LANG=C.UTF-8 -t toaruos/build-tools:1.8.x util/build-in-docker.sh
- name: Upload Branch Image
uses: actions/upload-artifact@v2
with:
name: image
path: ./image.iso
- name: Draft Release notes
if: startsWith(github.ref, 'refs/tags/v')
run: bash util/generate-release-notes.sh > notes.md
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ToaruOS ${{ github.ref }}
body_path: ./notes.md
draft: true
- name: Upload Release Image
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./image.iso
asset_name: image.iso
asset_content_type: application/x-iso9660-image
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -8,6 +8,7 @@

/.make/*
/base/bin/*
/base/lib/kuroko
/base/src
/_base
/cdrom/extra
Expand All @@ -33,7 +34,6 @@
/base/usr/bin/*
/base/usr/lib/*
/base/usr/share/python-demos
/base/usr/share/help

# Generic
/base/usr/share/aclocal
Expand Down Expand Up @@ -72,3 +72,6 @@

# SDL
/base/usr/include/SDL

# Kuroko build files
/base/usr/share/kuroko
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "kuroko"]
path = kuroko
url = git@github.com:kuroko-lang/kuroko
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

58 changes: 49 additions & 9 deletions Makefile
Expand Up @@ -38,14 +38,16 @@ LC=base/lib/libc.so
##
# APPS = C sources from apps/
# APPS_X = binaries
# APPS_Y = generated makefiles for binaries (except init)
# APPS_Y = generated makefiles for binaries
# APPS_SH = shell scripts to copy to base/bin/ and mark executable
# APPS_SH_X = destinations for shell scripts
APPS=$(patsubst apps/%.c,%,$(wildcard apps/*.c))
APPS_X=$(foreach app,$(APPS),base/bin/$(app))
APPS_Y=$(foreach app,$(APPS),.make/$(app).mak)
APPS_SH=$(patsubst apps/%.sh,%.sh,$(wildcard apps/*.sh))
APPS_SH_X=$(foreach app,$(APPS_SH),base/bin/$(app))
APPS_KRK=$(patsubst apps/%.krk,%.krk,$(wildcard apps/*.krk))
APPS_KRK_X=$(foreach app,$(APPS_KRK),base/bin/$(app))

##
# LIBS = C sources from lib/
Expand All @@ -58,12 +60,12 @@ LIBS_Y=$(foreach lib,$(LIBS),.make/$(lib).lmak)
SOURCE_FILES = $(wildcard kernel/*.c kernel/*/*.c kernel/*/*/*.c modules/*.c)
SOURCE_FILES += $(wildcard apps/*.c linker/*.c libc/*.c libc/*/*.c lib/*.c)

tags: $(SOURCE_FILES)
ctags -f tags $(SOURCE_FILES)
tags: $(SOURCE_FILES) $(wildcard kuroko/src/*.c kuroko/src/*.h)
ctags -f tags $(SOURCE_FILES) $(wildcard kuroko/src/*.c kuroko/src/*.h)

##
# Files that must be present in the ramdisk (apps, libraries)
RAMDISK_FILES= ${APPS_X} ${APPS_SH_X} ${LIBS_X} base/lib/ld.so base/lib/libm.so
RAMDISK_FILES= ${APPS_X} ${APPS_SH_X} ${APPS_KRK_X} ${LIBS_X} base/lib/ld.so base/lib/libm.so ${KUROKO_FILES}

# Kernel / module flags

Expand Down Expand Up @@ -99,6 +101,7 @@ KERNEL_OBJS += $(patsubst %.c,%.o,$(wildcard kernel/*/*/*.c))
##
# Kernel objects from kernel/ assembly sources
KERNEL_ASMOBJS = $(filter-out kernel/symbols.o,$(patsubst %.S,%.o,$(wildcard kernel/*.S)))
HEADERS = $(wildcard base/usr/include/kernel/*.h base/usr/include/kernel/*/*.h)

# Kernel

Expand Down Expand Up @@ -139,7 +142,6 @@ fatbase/mod:
##
# Modules need to be installed on the boot image
MODULES = $(patsubst modules/%.c,fatbase/mod/%.ko,$(wildcard modules/*.c))
HEADERS = $(wildcard base/usr/include/kernel/*.h base/usr/include/kernel/*/*.h)

fatbase/mod/%.ko: modules/%.c ${HEADERS} | fatbase/mod
${KCC} -nostdlib ${KCFLAGS} -c -o $@ $<
Expand All @@ -162,13 +164,15 @@ base/cdrom:
mkdir -p $@
base/var:
mkdir -p $@
base/lib/kuroko:
mkdir -p $@
fatbase/efi/boot:
mkdir -p $@
cdrom:
mkdir -p $@
.make:
mkdir -p .make
dirs: base/dev base/tmp base/proc base/bin base/lib base/cdrom cdrom base/var fatbase/efi/boot .make
dirs: base/dev base/tmp base/proc base/bin base/lib base/cdrom base/lib/kuroko cdrom base/var fatbase/efi/boot .make

# C Library

Expand All @@ -192,6 +196,34 @@ base/lib/libc.so: ${LIBC_OBJS} | dirs crts
base/lib/libm.so: util/lm.c | dirs crts
$(CC) -nodefaultlibs -o $@ $(CFLAGS) -shared -fPIC $^ -lgcc

KUROKO_OBJS=$(patsubst %.c, %.o, $(filter-out kuroko/src/module_% kuroko/src/rline.c kuroko/src/kuroko.c, $(sort $(wildcard kuroko/src/*.c))))
kuroko/%.o: kuroko/%.c
$(CC) $(CFLAGS) -DDEBUG -fPIC -c -o $@ $^

KUROKO_CMODS=$(patsubst kuroko/src/module_%.c,%,$(wildcard kuroko/src/module_*.c)) $(patsubst lib/kuroko/%.c,%,$(wildcard lib/kuroko/*.c))
KUROKO_CMODS_X=$(foreach lib,$(KUROKO_CMODS),base/lib/kuroko/$(lib).so)
KUROKO_CMODS_Y=$(foreach lib,$(KUROKO_CMODS),.make/$(lib).kmak)
KUROKO_KRK_MODS=$(patsubst kuroko/modules/%.krk,base/lib/kuroko/%.krk,$(wildcard kuroko/modules/*.krk kuroko/modules/*/*.krk))

KUROKO_FILES=$(KUROKO_CMODS_X) $(KUROKO_KRK_MODS) base/lib/libkuroko.so

base/lib/kuroko/%.krk: kuroko/modules/%.krk
@mkdir -p `dirname $@`
cp $< $@

.make/%.kmak: kuroko/src/module_%.c util/auto-dep.py | dirs
util/auto-dep.py --makekurokomod $< > $@

.make/%.kmak: lib/kuroko/%.c util/auto-dep.py | dirs
util/auto-dep.py --makekurokomod $< > $@

ifeq (,$(findstring clean,$(MAKECMDGOALS)))
-include ${KUROKO_CMODS_Y}
endif

base/lib/libkuroko.so: $(KUROKO_OBJS) | dirs crts ${LC}
$(CC) $(CFLAGS) -DDEBUG -shared -fPIC -o $@ $^ -lgcc

# Userspace Linker/Loader

base/lib/ld.so: linker/linker.c base/lib/libc.a | dirs
Expand Down Expand Up @@ -222,6 +254,10 @@ base/bin/%.sh: apps/%.sh
cp $< $@
chmod +x $@

base/bin/%.krk: apps/%.krk
cp $< $@
chmod +x $@

# Ramdisk
fatbase/ramdisk.img: ${RAMDISK_FILES} $(shell find base) Makefile util/createramdisk.py | dirs
python3 util/createramdisk.py
Expand Down Expand Up @@ -305,6 +341,8 @@ clean:
rm -f base/lib/crt*.o
rm -f ${MODULES}
rm -f ${APPS_Y} ${LIBS_Y} ${EXT_LIBS_Y}
rm -f ${KUROKO_FILES}
rm -f kuroko/src/*.o

ifneq (,$(findstring Microsoft,$(shell uname -r)))
QEMU_ARGS=-serial mon:stdio -m 1G -rtc base=localtime -vnc :0
Expand All @@ -329,9 +367,11 @@ fast: image.iso

.PHONY: headless
headless: image.iso
@qemu-system-i386 -cdrom $< ${QEMU_ARGS} \
-nographic -no-reboot \
-fw_cfg name=opt/org.toaruos.bootmode,string=headless
@qemu-system-i386 -cdrom $< -m 1G ${KVM} -rtc base=localtime ${QEMU_EXTRA} \
-serial null -serial mon:stdio \
-nographic -no-reboot -audiodev none,id=id \
-fw_cfg name=opt/org.toaruos.bootmode,string=headless \
-fw_cfg name=opt/org.toaruos.gettyargs,string="-a local /dev/ttyS1"

.PHONY: shell
shell: image.iso
Expand Down
5 changes: 2 additions & 3 deletions apps/about.c
Expand Up @@ -76,7 +76,7 @@ static void redraw(void) {

static void init_default(void) {
title_str = "About PonyOS";
icon_path = "/usr/share/logo_small.bmp";
icon_path = "/usr/share/logo_small.png";

{
version_str = malloc(100);
Expand All @@ -89,7 +89,7 @@ static void init_default(void) {
sprintf(version_str, "PonyOS %s", u.release);
}

copyright_str[0] = "(C) 2011-2020 K. Lange, et al.";
copyright_str[0] = "(C) 2011-2021 K. Lange, et al.";
copyright_str[1] = "-";
copyright_str[2] = "PonyOS is free software released under the";
copyright_str[3] = "NCSA/University of Illinois license.";
Expand Down Expand Up @@ -149,7 +149,6 @@ int main(int argc, char * argv[]) {

ctx = init_graphics_yutani_double_buffer(window);
load_sprite(&logo, icon_path);
logo.alpha = ALPHA_EMBEDDED;

redraw();

Expand Down

0 comments on commit f570335

Please sign in to comment.