I made OS,but There's bug!
The bug is, editor(this OS have editor and brainfuck interprinter) print only S.
If there's no bug, editor'll print what user input.
I use this script for build, linking,run.:
Code: Select all
# 1. 기존 파일 청소
rm -f *.o *.bin *.img && \
\
# 2. 어셈블리 컴파일 (io.asm은 반드시 elf32 포맷)
nasm -f bin boot.asm -o boot.bin && \
nasm -f elf32 io.asm -o io.o && \
\
# 3. C 파일 컴파일 (핵심 옵션: -mregparm=0 추가)
# 이 옵션이 있어야 C에서 넘긴 인자가 스택 [bp+4] 위치에 정확히 들어갑니다.
gcc -m16 -ffreestanding -fno-stack-protector -fno-PIC -mregparm=0 -c main.c edit.c bf.c && \
\
# 4. 커널 링크 (main.o가 반드시 맨 앞!!)
ld -m elf_i386 -Ttext 0x8000 -e main --oformat binary main.o edit.o bf.o io.o -o kernel.bin && \
\
# 5. OS 이미지 생성 및 플로피 규격(1.44MB) 맞추기
cat boot.bin kernel.bin > os.img && \
truncate -s 1440k os.img && \
\
# 6. QEMU 실행 (즉시 결과 확인)
qemu-system-i386 -drive format=raw,file=os.img
I try to print constant like A,but only print S.
Please help me!
My github link is:https://github.com/sunuhwang/MyOS/tree/main
Please tell me in github issue!
Thanks to read this post,.
Goodbye! have a nice Day!

