Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added troubleshoot section to the README.md #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ It includes everything you need to kick off a freestanding bootable `C` main, in
Prerequisites
---
* GCC cross compiler - https://wiki.osdev.org/GCC_Cross-Compiler
* qemu
* Qemu

Installing GCC cross compiler can be frustrating. Fortunately, there is a tool that helps ease up the installation. Check out - https://github.com/lordmilko/i686-elf-tools

Build / Run
---
Expand All @@ -23,6 +25,32 @@ Build / Run

```

# Troubleshooting ⚙️
## (1) Can't find command i686-elf-gcc or i686-elf-objcopy
- This is caused by incorrect installation of GCC Cross Compiler. If you've compiled / downloaded the compiler alongside other prerequisites in some other directory you need to add the compiler to the path. (https://stackoverflow.com/questions/22668565/how-to-add-cross-compiler-to-the-path)

```
export PATH=/home/me/gcc_cross_compiler_location/output/linux/bin/:$PATH
export CROSS_COMPILE=i686-elf-
```

## (2) Qemu won't load the grub / boot from the ISO file.
- It was most likely that this was caused because the ISO file is not generated properly. Try removing build/ directory and the ISO file before re-running the build script. Check the console output for any errors. A proper output that generates a bootable ISO file should look something like this:

```Drive current: -outdev 'stdio:bootable.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 216g free
Added to ISO image: directory '/'='/tmp/grub.Mpy9qk'
xorriso : UPDATE : 290 files added in 1 seconds
Added to ISO image: directory '/'='/home/dante/x86_os/build/run/iso'
xorriso : UPDATE : 294 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/usr/lib/grub/i386-pc/boot_hybrid.img'
ISO image produced: 2502 sectors
Written to medium : 2502 sectors at LBA 0
Writing to 'stdio:bootable.iso' completed successfully.
```

TODO
---
- [ ] add comprehensive documentation
Expand Down