Skip to content

Commit 6cc1e1a

Browse files
committed
Fixed cnputc crash on 1.76
1 parent 36ad1bd commit 6cc1e1a

File tree

6 files changed

+20
-5
lines changed

6 files changed

+20
-5
lines changed

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ make -j4
2525

2626
# Generate GRUB image
2727
cd ${path_orbital}
28+
tar -C resources -cf ${path_bin}/memdisk.tar boot
2829
${path_grub}/grub-mkimage -d ${path_grub}/grub-core \
29-
-O i386-pc -o bin/boot.img -p /boot/grub -c resources/boot.cfg \
30-
biosdisk part_msdos part_gpt gfxterm_menu fat bsd
30+
-O i386-pc -o bin/boot.img -m bin/memdisk.tar -c resources/boot/grub/boot.cfg \
31+
memdisk biosdisk part_msdos part_gpt gfxterm_menu fat tar bsd memrw configfile

resources/boot.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/boot/grub/boot.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
korbis (hd0,1)/orbisys-176
2+
source (memdisk)/boot/grub/env-176.cfg
3+
boot

resources/boot/grub/env-082.cfg

Whitespace-only changes.

resources/boot/grub/env-176.cfg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Enable cn_mute flag
2+
# ===================
3+
# During initialization in `hammer_time`, the function `pmap_bootstrap` is
4+
# called which will always call `printf` (and thus `cnputc`) on success.
5+
# This requires the `cn_devlist` data structure to be filled by `cninit`.
6+
# However, `cninit` is not called until after `pmap_bootstrap` has returned.
7+
# To prevent this issue, we manually enable the `cn_mute` flag, which will be
8+
# set or unset during `cninit` based on boot flags.
9+
# Values:
10+
# - 0x0 Disable cn_mute
11+
# - 0x1 Enable cn_mute
12+
write_dword 0x32B3A98 0x1
13+

0 commit comments

Comments
 (0)