Code Monkey home page Code Monkey logo

Comments (6)

ChanderG avatar ChanderG commented on June 9, 2024

By the way, I am on an Ubuntu 12.04 machine.
QEMU emulator version 1.0 (qemu-kvm-1.0)
NASM version 2.09.10
Cross compiled gcc exactly as prescribed.

from os-tutorial.

cfenollosa avatar cfenollosa commented on June 9, 2024

Hi ChanderG:

I just tried compiling and running it:

$ make run
i386-elf-gcc -ffreestanding -c kernel.c -o kernel.o
i386-elf-ld -o kernel.bin -Ttext 0x1000 kernel_entry.o kernel.o --oformat binary
i386-elf-ld: warning: cannot find entry symbol _start; defaulting to 0000000000001000
cat bootsect.bin kernel.bin > os-image.bin
qemu-system-i386 -fda os-image.bin

As you see, the 0x1000 is pretty much the default. Please make sure that you're using the correct syntax for your version of ld.

I'd suggest trying to set breakpoints in kernel.c to see if it's really jumping into it, or modify bootsect.asm to print KERNEL_OFFSET just before jumping into it, and check that it's really 0x1000

"Screen flickering" looks like the CPU is triple faulting and restarting over and over again. You can check that by using the qemu flag -d guest_errors,int and looking for a triple kernel panic-like dump.

Debugging this is pretty hard, I know. Good luck!

from os-tutorial.

s5bug avatar s5bug commented on June 9, 2024

After trying to print KERNEL_OFFSET, It gave me 0x0000 (using print_hex)

This is the first few lines of my boot.asm:

[org 0x7c00]
KERNEL_OFFSET equ 0x1000

mov bx, KERNEL_OFFSET
call print_hex
call println
jmp $

What is going wrong?

from os-tutorial.

s5bug avatar s5bug commented on June 9, 2024

When looking at my os-image.bin in xxd, I can see that it only goes up to offset 0x00000270 (plus some). When looking at kernel.bin the same way, it is placed at 0x00000200 in os-image.bin. I'm going to change KERNEL_OFFSET to see if that helps.

from os-tutorial.

s5bug avatar s5bug commented on June 9, 2024

Now the system hangs after printing "loading kernel into memory."

from os-tutorial.

cfenollosa avatar cfenollosa commented on June 9, 2024

Hi firestar115, thanks for your comment.

Unfortunately this is not the right place to discuss problems with your code, but rather to open issues related to the github project.

I'd suggest writing on the osdev forum where they will help you understand what's going on.

Regards,
Carlos

from os-tutorial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.