Page 3 of 3

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 12:10 am
by FusT
We can safely assume it's not the code that enables protected mode, since he's using GRUB which handles all of that.

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 12:11 am
by NunoLava1998
FusT wrote:We can safely assume it's not the code that enables protected mode, since he's using GRUB which handles all of that.
i changed to GRUB now. And it worked. Also got the bonus of not having to reinstall GRUB (just do the grub-mkrescue step in the Bare Bones tutorial, lol).

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 12:12 am
by NunoLava1998
ziggyfish2 wrote:So firstly use QEMU as this will give you access to some debugging information, that you can use to identify what the problem is. Use either the qemu -d , or the QEMU monitor to checkout what problems you are facing ( http://wiki.qemu.org/download/qemu-doc.html for more information on how to use it correctly).

Secondly, can you provide the qemu log file so we can tell you exactly what your problem is (I will not detail how to fix it though). Also provide your boot loader, as 0x07E00 address looks suspicious.

From what you have posted it looks like a problem with your interrupts, it seems you haven't disabled interrupts before you jump into protected mode. This needs to be done as the default interrupts that the BIOS provides are only 16bit, and will not work in 32 bit mode.
I used QEMU on the above picture, and i already got GRUB on the USB (i really have to use grub-mkrescue). It works on real hardware and emulators.

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 12:13 am
by NunoLava1998
If anyone didn't see the image,
Image

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 1:33 am
by iansjack
Congratulations. You have configured a GRUB menu.

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 2:46 am
by NunoLava1998
iansjack wrote:Congratulations. You have configured a GRUB menu.
Thanks. Now i'm making a I/O keyboard output, and i swear i'll probably use a library for this..
  • 0x1E = A
    0x30 = B
    0x2E = C
    0x20 = D
    0x12 = E
    0x21 = F
    0x22 = G
    0x23 = H
    0x17 = I
    0x24 = J
    0x25 = K
    0x26 = L
    0x32 = M
    0x31 = N
    0x18 = O
    0x19 = P
    0x10 = Q
    0x13 = R
    0x1F = S
    0x14 = T
    0x16 = U
    0x2F = V
    0x11 = W
    0x2D = X
    0x15 = Y
    0x2C = Z
    0x02 = 1
    0x03 = 2
    0x04 = 3
    0x05 = 4
    0x06 = 5
    0x07 = 6
    0x08 = 7
    0x09 = 8
    0x0A = 9
    0x0B = 0
    0x28 = '
    0x34 = .
    0x0C = -
    0x0D = =
    0x35 = /
    0x1A = [
    0x1B = ]
    0x27 = ;
    0x33 = ,

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 5:06 am
by NunoLava1998
Finally wrote the tty.h file. This is the ending ); parts of my file. Seriously:

Code: Select all

};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 6:54 am
by onlyonemac
This is not your osdev blog to post long code samples on. If you want to brag about how you wrote a "header file" to map keycodes to ASCII characters, get a free blog at WordPress.com or Blogger.

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 2:24 pm
by matt11235
NunoLava1998 wrote:Finally wrote the tty.h file. This is the ending ); parts of my file. Seriously:

Code: Select all

-snip
Then I think that you should consider rewriting the code.

Re: C code rebooting for no reason

Posted: Wed Oct 26, 2016 3:53 pm
by Schol-R-LEA
And I think that if you are going to ask us to debug the code you, ah, appropriated from Sewage Overflow and a mélange of several unrelated tutorials, you should at least have the courtesy of creating a cloud repo one GitHub or somewhere like that, which you can link to rather than coredumping this Frankensteinian mess onto the message boards here every time you run into a problem. You know, like I have told you to do at least twice before?

Assuming the mods don't come down on you about the COPPA thing, that is.