@# Quotes DB     useful, funny, interesting





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



Comments:

<0> well well well
<0> the switch implementation is 0.8s slower.
<1> haha
<0> XD
<2> when i am changing one of the control registers such as cr4 in smp system, should i use new methods to set it, such as stop one cpu untill i set its value too?
<3> depends on what you want to do.
<3> cr4 is per-processor, so if you need a change on all CPUs, you need to sync it across all CPUs
<3> but, changing cr4 shouldn't generally ever be done, except OS boot
<2> mwk:i am getting a protection error while i am trying to set a value to cr4 ( in kernel mode ) in a smp system, when i run the code with just one cpu enabled i do not get this protection error...
<3> well, what change to cr4, and on which CPU[s]?
<3> remember that cr4 is per-processor, so if you change it on one CPU, only this one CPU will see it.
<2> mwk:yes,but the result isnt intersting, i dont understand why i am getting protection error while i am in kernel mode
<3> what change?
<2> i am setting bit number 13 to 1
<2> and this cpu does support this mode ( vmx )
<3> VMXE, huh?



<2> yes
<3> do all CPUs in your system support VMX?
<3> and, does the fault happen exactly on the mov cr4 instruction?
<2> mwk:i will have to boot the machine to see this,but i do know that if i mark the mov cr4 instruction it doesnt give the error
<2> one seconed i will reboot it, and look at the kernel message
<4> whats better for learning? gas or nasm?
<5> its never wrong to learn both
<4> true, but which one should i start with?
<3> take gas for good gcc inline support
<3> or take nasm for similarity to windows ***emblers
<4> is there any ***embler which uses both the syntaxes?
<3> no, and don't hope for it.
<4> D:
<3> gas has intel-syntax mode, but it's only half-compatible
<3> yasm also announced that it supports each and every syntax ever made, but they don't seem to get it right
<1> IMHO nasm syntax is more intuitive
<2> mwk:well after a better looking it seems like the code does give the protection error even on one cpu booting...
<4> yeah when i look at gas syntax i vomit in my mouth but...
<2> mwk:may i show you the error message in /var/log/messages?
<6> i like the AT&T syntax more than intel syntax
<3> izik: okay, what is it?
<3> undesktop: ever tried to refer to C variable called 'eax' from intel syntax?
<1> *sigh*
<1> who names its variables eax... I don't
<6> someone might :)
<4> ;|]
<3> i happen to have a kernel-global c variable called 'cr0'...
<2> mwk:one moment i am pasting it online
<1> smokey991: well, nasm can do it
<6> ???
<1> mwk: ohohoh, at least you should have a convention to not pollute the global namespace... like adding "g_" to a global name
<3> why bother?
<2> http://rafb.net/p/wjEZk638.html
<2> mwk:"Starting" is a kernel message from the module that it started
<1> izik: btw, what do you want to do?
<3> izik: and the faulting instruction is?
<2> the code is:http://rafb.net/p/TNbdib85.html (and i know i could put the or inside the asm, but i split it for a purpose)
<3> izik: also, your binary skills terribly ****. it's setting bit *12* not 13 in cr4. which, according to sandpile.org, is undefined.
<2> when i am running insmod mod.ko i get segmention fault
<2> mwk:bit 13 = [ 12 ] when i am count from 0
<3> izik: everyone counts from 0. including intel people.
<3> 13 is friggen 13.
<2> so they talk about bit number 14?
<3> no. they talk about bit number 13. and you're setting bit number 12, ferchrisssake.
<2> ok
<3> ok? nah. it isn't ok. you're setting wrong bit.
<4> lol pwned
<1> about what bit you're talking about?
<3> undesktop: about bit in cr4 he's trying to set
<3> 1 unsigned long t=(1<<12);
<3> and VMXE is bit 13 of cr4
<1> but what is that bit supposed to do?
<1> ah, VMXE
<3> it's or'ed into cr4
<3> izik: also, why use the mov to %rax, when you can just specify "r" constraint instead?
<2> mwk:you are right,i did alot of modifictions to this code, and didnt look what is good way to do things, i just tried to figured out some things...
<3> izik: ok, so, does the corrected version work?
<2> one moment...
<2> mwk:yes,thanks
<5> i used the "adr" instruction to load a symbol-address into r0 and gas generated "sub r0,pc,#8" but thats crap, isnt it?
<7> no



<5> but i change my programm-counter
<5> its like a branch
<7> adr is a psuedo instruction, it means put the address of a symbol into Rx. sub r0,pc,#8 means put the address 2 words below the pc into r0
<7> sub r0,pc,#8 => r0 = pc - 8
<7> the thing you're pointing to in r0 will be 8 bytes from the pc
<5> so its not like pc=pc-8 r0=pc
<7> no
<5> hmm the entry-point of the binary is at 0x8734 but the data section starts at 0x108b0 so "sub r0,pc,#8" still wont work
<7> will it get modified by the ELF loader?
<7> ie: will it be subjected to relocation or anything like that?
<5> no
<5> its just a .asciz
<7> ah k
<7> are you sure that's what the adr is being ***embled into? :)
<5> yes absolutely
<5> its just a short function which does to swi's
<5> has only six instructions
<7> if you like, you could paste the ***embler and the resulting instructions somewhere
<5> thats the first one which loads a pointer to a path in r0
<5> yea
<5> sec
<7> the ***embly, even
<5> http://rafb.net/p/Kn19kX63.html
<7> what's menuDir and menuCmd? what addresses are they?
<5> menuDir is at 0x10b80 and menuCmd is at 0x10b8a
<5> according to readelf
<7> I reckon those instructions will be modified by the ELF loader
<5> basically the function changes the working-dir and calls execve
<7> they are ripe for relocation
<0> guh
<0> I must be getting tired
<0> short question: fld a; fld b; fld c; fdiv ST(1), ST; fdivp ST(2), ST; how does the fpu stack look like now?
<0> it should be [a/c][b/c], but for some reason it seems it isn't
<0> I found a bug in the gdc asm {} statement :D
<1> which
<0> problems with an ***embler statement and working directly on inout parameters on the floating point stack
<0> I'll narrow it down
<8> What happens if I JMP into a procedure instead of calling it at the RET?
<8> is it simply ignored?
<1> norc: erm... ignored??
<1> like.. the CPU think "oh I won't execute that instruction, it looks filthy"
<1> thinks
<9> if cpus refused to execute filthy instructions, x86 processors wouldn't do a whole lot =P
<4> whats the best and simplest text editor for the AT&T syntax?
<10> emacs :)
<4> simplest ;( ?
<10> nano
<9> cat
<0> edlin?
<4> can nano have asm syntax tho?
<9> nano doesnt check syntax...you can write whatever you like in there
<1> ...that's freedom
<4> :D
<0> on a pentium mmx, what's the fastest way to calculate two sine values on the fpu?
<0> more importantly, can somebody link me to a document describing how to determine this?
<0> woah
<0> sleep deprivation is giving me superpowers
<0> since the following code worked on first try
<0> fld pi; fxch; fpremloop: fprem1; fstsw AX; and 1, AH; jnz fpremloop; fxch; fstp ST; fxch; fstp ST; fld ST; fld ST; fabs; fmulp ST, ST(1); fld sin_c; fmulp ST, ST(1); fxch; fld sin_b; fmulp ST, ST(1); faddp ST, ST(1);
<0> :D
<0> I do think it's slower though
<0> "optimized sine" :D
<8> what happens if I never pushed something onto the stack and I pop a register? is it just cleared?
<3> no. it pops off the stack.
<3> whatever happens to be at location of stack pointer
<8> so I cannot predict what happens generally, because I dont know the value in the cell of the stack pointer?
<3> possibly you get 0, possibly you get junk, possibly you get a segfault, possibly your system crashes
<8> mhm


Name:

Comments:

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






Return to #asm
or
Go to some related logs:

#css
mount: RPC: Remote system error - Connection refused
intel brookdal
#debian
gumdrups
ndiswrapper takes forever to authenticate in ubuntu
#math
#perl
#web
#lisp



Home  |  disclaimer  |  contact  |  submit quotes