@# Quotes DB     useful, funny, interesting





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



Comments:

<0> aside from look at it and go 'oh yeah it works'
<0> i doesn't require proof. it requires looking at it for half a second
<0> you're using the top 10 bits of the address as an index into the page directory, ergo you shift by (32 - 10) bits
<1> im still a little slow in getting it though :(
<1> do i count the most significant bits from the right? or left?
<0> I'm sure there's a mathematical statement somewhere that says that shifting works as designed (though on signed ints it's slightly different)
<0> oooh, I see you dont have a full grasp of shifting. gotcha
<0> when you shift to the right, you're shifting out LSBs
<0> so bits to the 'left' are more significant
<0> note this has nothign to do with endianness. it's merely how numbers are represented in an arabic system
<1> ok. give me a minute to digest that
<0> also, for every shift to the right it's the equivalent of dividing by 2
<0> oh tyou know the significant bit stuff. it' sprecisely the same way as in base 10, like you've been using for years
<1> holy crap! i think i got it !
<1> hahaha
<0> you just dont really ever shift in base 10. it's not terribly useful



<1> ok .. lemme se if i got it correct :)
<1> going back to head.s
<0> that's a terrible place to learn how to shift numbers
<2> lol wow
<2> just read that
<2> so true so true
<0> since it's linux, it's done in the most 31337 way possible for MAXXXXIMUM SPEED
<3> ....that's why my timer functionality stoped responding...
<1> aside from identity mapping the first 8mb.. it also does the same thing to index 0x300 in the pde
<1> that would explain page_pde_offset = (__PAGE_OFFSET >> 20);
<1> correct?
<2> it's not for speed, it's just to make whoever programmed that portion look more awesome
<0> yes
<0> geezusfreeek++; // so true
<1> if i get the 10 most significant bits of 0xc000 0000 .. i get 0x300
<2> linux is not particularly fast, IMO
<2> or not as fast as it could be
<1> which is added to _swapper_pg_dir to get the virtual address of the higher half?
<0> that's where you went off the edge
<0> you get the virtual address of what?
<1> why cant the kernel devs just do things as simple as "printf("hello world\n") sometimes? :p
<1> of the kernel ? which is 0xc00 0000 ? or am i still way off
<0> well, I'm not precisely sre what you mean by 'to get the virtual address'
<0> and i dont like to answer questions that I'm not positive you're asking the right one
<0> otherwise I'll just lead you astray
<0> and sorry for the delay, had to switch machines
<0> and the other one took forever to boot up
<1> its ok. i realize though that i still need to look at things more
<1> hehehe so i can ask question more correctly
<0> http://newos.org/WebSVN/filedetails.php?repname=NewOS&path=%2Fnewos%2Fkernel%2Farch%2Fi386%2Farch_vm_translation_map.c&rev=0&sc=0
<0> look a few lines in at around ADDR_SHIFT
<0> there are a few macros to move bits around
<1> okie dokie
<0> though i didn't use shift, I used divide
<0> which if it's a power of 2 the compiler emits precisely the same code
<4> any ideas what might be wrong when IDT doesn't work all the sudden
<0> how are you sure the IDT is at fault?
<4> not really
<0> okay, so then rephrase your question
<4> just trying to get divided by zero exception
<4> and it used to work and doesn't anymore
<0> okay, so what did you change?
<0> track back until it works
<4> nothing related to IDT
<4> and I went back and it didn't work
<0> you went back to an old version and it didn't work?
<0> if so, then it never really did work
<0> thus your basic ***umption probably isn't correct either
<4> yeah well I didn't have svn commit for that version
<1> geist: thanks! btw, did i (at least) get some things right? like why the bit shifting is >> 20 and not 22?
<0> schoolboy: remember, their code is calculating the *offset* into the pgdir, not the entry
<0> and since each entry is 4 bytes, that amounts to 2 bits of shift
<0> so they're actually doing this: ((blahblah >> 22) << 2)
<4> for IDT there is only lidt and it should work, right?
<4> after setting it to proper address of course
<0> Tenttu: first part of the question yes, second part depends
<1> will do..
<0> schoolboy: actually their code is subtly broken with a lot of addresses
<0> it's basically stupid
<1> aww
<0> ((blahblah >> 22) << 2) == ((blahblah >> 22) * 4)



<0> gdt entry index = (blahblah >> 22)
<0> gdt entry offset = gdt entry index * 4 = gdt entry index << 2
<0> does this make sense?
<1> not... yet
<0> do you understand the concept of entry versus index?
<0> the offset into the table instead of the index into the table is better put
<1> i guess i've got them both mixed up
<0> you know how an array works?
<4> just wondering might the issue be related to recompilation of my cross-compiler >:/
<0> Tenttu: very likely
<4> yea
<1> you see.. there are three lines which made me confused between the two :(
<4> everything else is working fine though
<1> can i post them here ?
<4> even libstdc++ now
<0> schoolboy: address of(foo[index]) == address of(foo) + index * size of array entry
<0> Tenttu: dont know. sounds like you're smart enough to figure it out though
<0> can't really help ya
<1> 1) page_pde_offset = (__PAGE_OFFSET >> 20);
<1> 2) movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
<1> 3) movl %ecx,page_pde_offset(%edx) /* Store kernel PDE entry */
<0> oh god.
<4> geist: yeah :)
<0> why the hell are you trying to learn from this ****?
<4> it's just useful to get second opinion
<1> geist: you mean me?
<0> yes
<0> this is terrible code to be trying to figure stuff out on
<0> i dont even know what __PAGE_OFFSET is supposed to be
<0> the name of the variable certainly isn't telling me anything
<1> coz the only paging tutorial i can find on the web are those showing only how to "identify map" :(
<5> join #freebsd
<5> sorry i typed in the wrong window :|
<0> schoolboy: well, basically almost all the problems yoiu're having are specifically that code, not the general concepts of paging
<0> it's because that code is trying to be more clever than it needs to be, and actually looks subtly broken for various inputs
<0> did you look at the link I pasted?
<1> yep.. still looking
<0> specfically
<0> #define VADDR_TO_PDENT(va) (((va) / PAGE_SIZE) / 1024)
<1> sorry.. i always need a few minutes.. (days) to understand stuff :(
<0> that is almost precisely the same code
<1> btw __PAGE_OFFSET is defined to be (0xC0000000) at /usr/include/asm/page.h
<0> it's just the base of the new kernel's address
<0> __KERNEL_BASE would probably be a better name
<1> wow.. how long did it take you to really understand paging concepts?
<0> i dunno. i never sat down one day to learn it
<0> i picked up stuff over quite a few years and i finally had enough bits to start putting it all together
<1> im getting a bit frustrated honestly.. :(
<0> how old are you?
<1> is 21 too old ?
<0> was gonna say if you were 12 or something i'd say go outside and have fun
<0> i've seen too manyu of them try to dig into it, and thye're just not ready to deal with it
<0> i hacked my first os around 22 or so
<0> so it's a good time
<0> i think about 21 i had hacked together a hello world thingy from example code
<0> enough to fire interrupts, etc
<0> a year or so later i started to write one for real
<1> i need a girlfriend :(
<0> that being said I'm a bit worried about you not being really familiar with shifting
<0> that's a pretty basic low level bit twiddling thing that you're going to have to know instinctively
<0> same with masking, modulus, etc
<1> nah.. i guess i didn't look at things very well
<1> anway.. i'll start all over again with this whole paging thing tonight
<0> if it make syou feel any better it took about a minute for me to figure out why they were shifting by 20 instead of 22
<0> yeah, and I'd *highly* suggest never looking at that linux code again
<0> it's got very little to do with paging and more to do with being tricky because it's halfway mapped in two locations at once, etc
<1> cool
<0> anywayk i sleep now
<1> okie dokie.. thanks again
<4> ah finally got my idt issue figured out
<4> had turned optimization on and of course it optimised out my divided by zero line :)
<0> Tenttu: oh heh. duh
<0> the easiest way to fire an interrupt is the int instruction
<0> asm("int $somenumber");


Name:

Comments:

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






Return to #osdev
or
Go to some related logs:

#asm
vaio ubuntu trackpad tap
rudin gaps rational
usb modules explanation ehci_hcd
#css
ffmpeg-dev ubuntu
etch /dev/xconsole
UPS- BGLAD
skype libXss
Adaptive Server cannot perform the requested action because column



Home  |  disclaimer  |  contact  |  submit quotes