ci: code analysis

This commit is contained in:
d0p1 🏳️‍⚧️ 2024-05-28 13:50:12 +02:00
parent 2a1dbf2e57
commit 1110bc9ac7
4 changed files with 30 additions and 12 deletions

26
.github/workflows/analyze.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Code Analysis
on:
push:
branches:
- main
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt update
sudo apt install shellcheck cppcheck
- name: Run shellcheck
run: |
shellcheck ./build.sh ./releasetools/cdimage.sh ./releasetools/floppyimage.sh ./releasetools/hdimages.sh ./releasetools/image.defaults ./releasetools/images.functions
- name: Run CppCheck
run: |
cppcheck -x c --std=c89 --quiet --error-exitcode=2 include sbin bin

View file

@ -16,13 +16,10 @@ RM = rm -f
MK_BUGREPORT := \"https://git.cute.engineering/d0p1/StupidOS/issues\"
MK_COMMIT := \"$(shell git rev-parse --short HEAD)\"
ifneq (,$(findstring cl,$(CC)))
CFLAGS = /TC /D MK_COMMIT="$(MK_COMMIT)" /DMK_BUGREPORT="$(MK_BUGREPORT)" /INCLUDE:$(TOPDIR)include
LDFLAGS = /SUBSYSTEM:CONSOLE
else
CFLAGS = -DMK_COMMIT="$(MK_COMMIT)" -DMK_BUGREPORT="$(MK_BUGREPORT)" -I$(TOPDIR)include
LDFLAGS =
endif
QEMU_COMMON = \
-rtc base=localtime \
@ -93,7 +90,7 @@ run: all
-drive file=fat:rw:./sysroot,if=none,id=hdd \
-device floppy,drive=boot \
-device ide-hd,drive=hdd \
-global isa-fdc.bootindexA=0 \
-global isa-fdc.bootindexA=0
.PHONY: run-iso
run-iso: all

View file

@ -1,7 +1,3 @@
struc
{
.boot_jmp db 3 dup(?)
}
disk_read_sectors:
test byte [drive_lba], 1

View file

@ -123,7 +123,6 @@ drive_lba db 0
msg_stage2 db "StupidOS Loader", 0
kernel_fat12_file db "VMSTUPIDSYS", 0
config_fat12_file db "BOOT INI", 0
msg_error_a20 db "ERROR: can't enable a20 line", 0
msg_error_memory db "ERROR: can't detect available memory", 0
msg_error_sector db "ERROR: reading sector", CR, LF, 0