32bit protected mode init problem

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.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: 32bit protected mode init problem

Post by egos »

Casm wrote:
dw gdt_end - gdt - 1
It seems to me that should be: dw gdt_end - gdt + 1.
No. GDT_SIZE = GDT_END-GDT, GDT_LIMIT = GDT_SIZE-1.
czlowieczek wrote:

Code: Select all

[bits 32]         ;before jump
No comments... :cry:
If you have seen bad English in my words, tell me what's wrong, please.
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: 32bit protected mode init problem

Post by Casm »

Are you sure ds has got zero in it when your code gets control?
czlowieczek
Posts: 21
Joined: Wed Jul 10, 2013 3:00 am

Re: 32bit protected mode init problem

Post by czlowieczek »

Ok, I'm finally in 32 bit protected mode, thank you guys for help :)

part of my log in bosch:

00104800000p[WGUI ] >>PANIC<< POWER button turned off.
00104800000i[CPU0 ] CPU is in protected mode (active)
00104800000i[CPU0 ] CS.mode = 32 bit
00104800000i[CPU0 ] SS.mode = 32 bit
00104800000i[CPU0 ] EFER = 0x00000000
00104800000i[CPU0 ] | EAX=00000010 EBX=00000002 ECX=00090010 EDX=00000000
00104800000i[CPU0 ] | ESP=00008000 EBP=00000000 ESI=000e0203 EDI=00000200
00104800000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf
00104800000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00104800000i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 ffffffff 1 1
00104800000i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00104800000i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00104800000i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00104800000i[CPU0 ] | FS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00104800000i[CPU0 ] | GS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00104800000i[CPU0 ] | EIP=00000553 (00000553)
00104800000i[CPU0 ] | CR0=0x60000011 CR2=0x00000000
00104800000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00104800000i[CPU0 ] 0x0000000000000553>> jmp .-2 (0x00000553) : EBFE

Every segment is loaded and cs is loaded good.
(Last jump is in infinite loop)
Thank you again :D
Post Reply