@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4



Comments:

<0> !!!
<1> well
<1> look
<1> er wait
<0> i guess E9 is a 'near jump' and EA is a 'far jump'
<0> near jump only needs 16 bits
<1> ah
<0> for address to jump to
<1> you need a far jump
<1> because your jumping to a different segment then the current one
<1> because you set up your segments
<0> billfur: what segment registers would i have to change to allow the 'near jump' version to work?
<1> why can't you farjump it
<1> er wait, no
<1> I think your descriptor is wrong
<0> billfur: if by far jump you mean jmp KERNEL_ADDRESS:0 then yes i can



<0> billfur: the gdt stuff isn't being used
<0> billfur: ignore gdt data at bottom of boot loader
<0> billfur: pmode is a future TODO
<0> billfur: welcome back! :)
<1> I don't think that matters
<0> billfur: what you mean my descriptor is wrong?
<1> hm
<0> billfur: i don't know if this helps but i got some bochs info...
<0> billfur: i get this a zillion times.... MOV_EwSw: using of nonexisting segment register
<0> billfur: and here is cpu state when i killed bochs....
<0> 00000796500i[CPU ] real mode
<0> 00000796500i[CPU ] CS.d_b = 16 bit
<0> 00000796500i[CPU ] SS.d_b = 16 bit
<0> 00000796500i[CPU ] | EAX=00170002 EBX=00000000 ECX=00170002 EDX=00000000
<0> 00000796500i[CPU ] | ESP=00007000 EBP=00000000 ESI=00007344 EDI=0000ffde
<0> 00000796500i[CPU ] | IOPL=0 NV UP DI PL NZ NA PO NC
<0> 00000796500i[CPU ] | SEG selector base limit G D
<0> 00000796500i[CPU ] | SEG sltr(index|ti|rpl) base limit G D
<0> 00000796500i[CPU ] | DS:7e00( 0000| 0| 0) 0007e000 0000ffff 0 0
<0> 00000796500i[CPU ] | ES:b800( 0000| 0| 0) 000b8000 0000ffff 0 0
<0> 00000796500i[CPU ] | FS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
<0> 00000796500i[CPU ] | GS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
<0> 00000796500i[CPU ] | SS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
<0> 00000796500i[CPU ] | CS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
<0> 00000796500i[CPU ] | EIP=0000fd6c (0000fd6c)
<0> 00000796500i[CPU ] | CR0=0x60000010 CR1=0x00000000 CR2=0x00000000
<0> 00000796500i[CPU ] | CR3=0x00000000 CR4=0x00000000
<0> billfur: i heard you can set up bochs to do debugging and step thru code...i think i'll need to look into that
<0> billfur: you can see above that cs is now 0x0000 in crashing 'new' version
<1> seb-: jmp implicitly references CS
<1> so jmp addr becomes jmp CS:addr
<0> billfur: so i should do jmp 0x0000:KERNEL_ADDRESS ?
<0> billfur: wait....cs *is* 0x0000 already in 'bad' version
<1> what?
<1> where?
<1> ah
<0> billfur: i do following to set cs to zero...
<0> jmp 0x0000:next_address1
<0> next_address1:
<0> in boot loader
<1> ok change
<0> yes
<1> you need to set the present gbit
<0> billfur: what is that?
<0> billfur: also..not sure what ds value affects
<1> hm, maybe not
<1> try loading your CS descriptor
<1> do you have a copy of the intel system programming docs?
<0> billfur: yes i think
<1> 3.4.5
<1> and read the first few chapters too =p
<0> billfur: cs descriptor is for protected mode right?
<1> I believe the answer is "no"
<1> actually, have you tried not zeroing CS
<1> or, hm
<0> billfur: actually my end goal was to zero all segment registers...
<1> ok
<1> *looked it up*
<0> billfur: that seems the most elegant.....and...in pmode i think that is only way to stay sane
<1> you have to farjump the first time to set the CS register
<0> yes i did that



<0> billfur: ok, i pulled up 3.4.5
<1> uh
<0> <reading>
<0> yes?
<0> billfur: 3.4.4 talks about 'ia-32 mode' i think this is for pmode only
<1> segmenets are for real mode
<1> trust me
<1> but I'm not sure why thats not working
<0> billfur: yes but their usage is diff....ok reading
<1> are you sure its crashing on the jump instruction
<0> billfur: no
<1> oh
<1> I'm not clear on where its entering the other code
<1> oh, er
<1> I have an obvious answer
<1> jmp is relative
<0> billfur: you mean the 'kernel' ?....at the very beg i guess
<0> billfur: OH YOUR KIDDING
<1> not an immediate
<1> haha
<1> I feel stupid
<0> billfur: NOT THAT OLD THING AGAIN!!!
<1> hahaa
<0> billfur: *you* feel stupid...
<0> billfur: this is *second* time i got bit by that tonight!
<1> well I've been working on hacks to deal with the problem all day =p
<0> billfur: wait....when you do a far jump e.g. jmp A:B....the A part is absolute but NOT the B part right?
<1> right.
<0> billfur: so that is why jmp KERNEL_ADDRESS:0 is ok
<1> hm, you solved my problem too lol
<0> billfur: so jmp (KERNEL_ADDRESS - $) might work
<1> I can avoid all of my hacks and farjump it =p
<1> right
<0> billfur: er maybe subtract 2 from that
<0> billfur: like for jmp $
<0> FE = -2
<0> ..etc.
<1> what do you do for a living?
<1> if you don't mind me asking
<0> billfur: i'm a physicist trying to become a programmer
<0> billfur: so i'm a math guy
<1> for a living or for projects?
<0> billfur: i've been doing programming for a living for 6 years but never felt like i had a deep understanding of computers....writing an os is sort of my way to fix that
<1> ah
<0> billfur: learning asm and now os ideas has been a godsend..it has really helped
<1> learning asm is a cureall =p
<0> billfur: yea everyone should do it
<0> well everyone who wants to understand that is
<1> are farjumps legal in protected mode?
<0> billfur: i believe so because pmode has segments too....it is just that no one choses to use them cuz a segment can be 4 Gb
<1> well, in protected mode, non ring 0
<0> billfur: well wait.....in pmode you fill segment registers with things called 'selectors'
<0> billfur: that point to GDT entry...hmmm. not sure
<0> billfur: you can have multiple cs's and ds's i think
<0> well i
<0> 'm
<0> getting sleepy
<0> i hope i see you again in here
<1> I'll be around tommorow
<0> i hope i can return the favor somehow in the future
<0> ok
<1> seb-: you never know =)
<0> true...thanks again
<0> and good nite
<1> night
<2> hey guys, I'm ***embling a binary with nasm (nasm -f bin that is) and I have the elf header and my program in there as needed and it runs fine (without segfaulting, which it was before anyway) but it won't output "hello world", which I hoped it should (I'm using the linux system call int 0x80 for that)..and I don't see the problem unfortunately, if someone has time maybe they can look at a pastebin of it?
<2> uh nevermind, forgot to have my .data section :)
<3> hello
<4> i gang
<4> to hold the address of an instruction, pc requires 4 bits. correct?
<5> smax: *bytes
<5> (for 32-bit arch)
<4> for 32bit instructions ?
<4> how large is an opcode for a 32bit instruction? 4bits or 8


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #asm
or
Go to some related logs:

#lisp
#php
#web
nxserver startx
multimux .deb
+python import os 'listdir' *.
#gimp
best free python ide
portage delete resuming download
Module via_rhine not found



Home  |  disclaimer  |  contact  |  submit quotes