C code rebooting for no reason

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
FusT
Member
Member
Posts: 91
Joined: Wed Sep 19, 2012 3:43 am
Location: The Netherlands

Re: C code rebooting for no reason

Post 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.
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: C code rebooting for no reason

Post 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).
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: C code rebooting for no reason

Post 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.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: C code rebooting for no reason

Post by NunoLava1998 »

If anyone didn't see the image,
Image
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: C code rebooting for no reason

Post by iansjack »

Congratulations. You have configured a GRUB menu.
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: C code rebooting for no reason

Post 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 = ,
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: C code rebooting for no reason

Post by NunoLava1998 »

Finally wrote the tty.h file. This is the ending ); parts of my file. Seriously:

Code: Select all

};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: C code rebooting for no reason

Post 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.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: C code rebooting for no reason

Post 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.
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: C code rebooting for no reason

Post 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.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Post Reply