Jmp does not work in protected mode

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.
Post Reply
gabemaiberger
Member
Member
Posts: 40
Joined: Tue Nov 13, 2012 2:54 pm

Jmp does not work in protected mode

Post by gabemaiberger »

Hello, the jmp opcode does not work in protected mode in the file kernel.asm. I think I loaded my gdt correctly. Can anybody help me?
Attachments
kernel.asm
(131 Bytes) Downloaded 31 times
bootload.asm
(1.6 KiB) Downloaded 58 times

Code: Select all

var myCat="marshmallow"
User avatar
Nessphoro
Member
Member
Posts: 308
Joined: Sat Apr 30, 2011 12:50 am

Re: Jmp does not work in protected mode

Post by Nessphoro »

Not sure if you're trolling or not.

Code: Select all

start:
jmp start
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Jmp does not work in protected mode

Post by iansjack »

As always, single-step through the code in a debugger. These sort of errors are trivial and give you good experience of debugging for when you get on to the difficult stuff.
gabemaiberger
Member
Member
Posts: 40
Joined: Tue Nov 13, 2012 2:54 pm

Re: Jmp does not work in protected mode

Post by gabemaiberger »

Where can I get a single step debugger?

Code: Select all

var myCat="marshmallow"
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Jmp does not work in protected mode

Post by iansjack »

Difficult to say, since I don't know what Operating System you are running on or what toolset you are using.

I use Linux with the GNU toolset and GCC. The most common debugger there is gdb which you can use in conjunction with qemu. I use a GUI front end called ddd which makes life slightly simpler. Or you can use an emulator with a debugger built in. I don't use Bochs but I understand that provides debugging facilities. I am a fan of SimNow from AMD, which provides a very convenient interface for debugging the early stages of an OS. Unfortunately this is now only available for Linux.

You may be developing on another OS. In that case you are going to have to search out your own debugger (although I believe the GNU toolset is also available on Windows). Whatever, I strongly recommend that you find a debugger that suits you and learn how to use it. Unless you are a genius at just looking at code, or memory dumps, and seeing what is wrong you will find OS development very difficult without debugging facilities.

You could even just search through these forums. The sort of question that you ask has been asked many times before; indeed there is another running thread currently on an almost identical issue. You will be extremely fortunate if you can persuade people to review your code to find your mistakes for you.
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: Jmp does not work in protected mode

Post by Kazinsal »

Nessphoro wrote:Not sure if you're trolling or not.

Code: Select all

start:
jmp start
I have no words.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Jmp does not work in protected mode

Post by Mikemk »

Blacklight wrote:
Nessphoro wrote:Not sure if you're trolling or not.

Code: Select all

start:
jmp start
I have no words.
yeah, I knew better than that when I started
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Post Reply