Skip to content

Commit dfc0e94

Browse files
Remove the version checksum from the kernel (#1)
Remove the unnecessary version checksum from the kernel
1 parent 4ea389c commit dfc0e94

File tree

5 files changed

+7
-20
lines changed

5 files changed

+7
-20
lines changed

.vscode/c_cpp_properties.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
],
99
"defines": [
1010
"__VERSION_STRING=\"ChaOS [Ver 0.2.yymmdd] made by Filiprogrammer\\n\"",
11-
"__VERSION_CHECKSUM=0xAB"
1211
],
1312
"compilerPath": "${workspaceFolder}/tools/i686-elf-tools-windows/bin/i686-elf-gcc.exe",
1413
"cStandard": "c99",
@@ -23,7 +22,6 @@
2322
],
2423
"defines": [
2524
"__VERSION_STRING=\"ChaOS [Ver 0.2.yymmdd] made by Filiprogrammer\\n\"",
26-
"__VERSION_CHECKSUM=0xAB"
2725
],
2826
"compilerPath": "${workspaceFolder}/tools/i686-elf-tools-linux/bin/i686-elf-gcc",
2927
"cStandard": "c99",

kernel/BUILD.bat

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,10 @@ if "%1" neq "" (
2222

2323
set version_string=ChaOS [Ver 0.2.%date:~8,2%%date:~3,2%%date:~0,2%] made by Filiprogrammer\n
2424

25-
for /f "tokens=*" %%a in (
26-
'BSDChecksum.exe "%version_string%"'
27-
) do (
28-
set version_checksum=%%a
29-
)
30-
3125
mkdir obj >nul 2>&1
3226
mkdir obj-test >nul 2>&1
3327

34-
make DEBUG=%DEBUG% TEST=%TEST% VERSION_STRING="%version_string%" VERSION_CHECKSUM=%version_checksum% --makefile=makefile SHELL=cmd || goto ERROR
28+
make DEBUG=%DEBUG% TEST=%TEST% VERSION_STRING="%version_string%" --makefile=makefile SHELL=cmd || goto ERROR
3529

3630
goto EOF
3731

kernel/build.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ while [ $# -gt 0 ] ; do
2929
done
3030

3131
version_string="ChaOS [Ver 0.2.$(date +'%y%m%d')] made by Filiprogrammer\n"
32-
version_checksum=$(BSDChecksum "$version_string")
3332

3433
mkdir obj 2>/dev/null
3534
mkdir obj-test 2>/dev/null
3635

37-
make DEBUG=$DEBUG TEST=$TEST VERSION_STRING="$version_string" VERSION_CHECKSUM=$version_checksum --makefile=makefile SHELL=sh || error
36+
make DEBUG=$DEBUG TEST=$TEST VERSION_STRING="$version_string" --makefile=makefile SHELL=sh || error

kernel/makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ else
4545
endif
4646
ifeq ($(TEST), 1)
4747
ifeq ($(DEBUG), 1)
48-
@$(CC) $(CFLAGSDEBUG) "-D__VERSION_STRING=\"$(VERSION_STRING)\"" -D__VERSION_CHECKSUM=$(VERSION_CHECKSUM) -Isrc-test/include -D__TEST -c -o $@ $<
48+
@$(CC) $(CFLAGSDEBUG) "-D__VERSION_STRING=\"$(VERSION_STRING)\"" -Isrc-test/include -D__TEST -c -o $@ $<
4949
else
50-
@$(CC) $(CFLAGS) "-D__VERSION_STRING=\"$(VERSION_STRING)\"" -D__VERSION_CHECKSUM=$(VERSION_CHECKSUM) -Isrc-test/include -D__TEST -c -o $@ $<
50+
@$(CC) $(CFLAGS) "-D__VERSION_STRING=\"$(VERSION_STRING)\"" -Isrc-test/include -D__TEST -c -o $@ $<
5151
endif
5252
else
5353
ifeq ($(DEBUG), 1)
54-
@$(CC) $(CFLAGSDEBUG) "-D__VERSION_STRING=\"$(VERSION_STRING)\"" -D__VERSION_CHECKSUM=$(VERSION_CHECKSUM) -c -o $@ $<
54+
@$(CC) $(CFLAGSDEBUG) "-D__VERSION_STRING=\"$(VERSION_STRING)\"" -c -o $@ $<
5555
else
56-
@$(CC) $(CFLAGS) "-D__VERSION_STRING=\"$(VERSION_STRING)\"" -D__VERSION_CHECKSUM=$(VERSION_CHECKSUM) -c -o $@ $<
56+
@$(CC) $(CFLAGS) "-D__VERSION_STRING=\"$(VERSION_STRING)\"" -c -o $@ $<
5757
endif
5858
endif
5959
ifeq ($(OS),Windows_NT)

kernel/src/ckernel.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ bool fpu_install() {
4949
static void init() {
5050
clear_screen();
5151
settextcolor(14, 0);
52-
char* welcomemsg = __VERSION_STRING;
53-
if (BSDChecksum(welcomemsg) == __VERSION_CHECKSUM)
54-
puts(welcomemsg);
55-
else
56-
reboot();
52+
puts(__VERSION_STRING);
5753
time_t ptm;
5854
time_read_rtc(&ptm);
5955
printf("Date: %d.%d.%d\n", ptm.day, ptm.month, ptm.year);

0 commit comments

Comments
 (0)