| |
| |
| |
|
Page: 1 2
Comments:
<0> mwk: but a push is gonna want to decrease esp...and if esp=ss=0 you got problems right? <1> seb-: then esp underflows to 0xffffffc. any problems? <1> besides, if ss=0, it's stack fault. ss descriptor cannot be null. <0> mwk: are you telling stack can happily grown down from 0 w/o any problems?...0xffff fffc, 0xffff fff8, etc> <0> s/telling/telling me <1> yes. it's just that this area of virtual space is used by kernel on some systems, so it'll be segfault. <1> but if you have an OS that makes those areas accessible to userspace, it's alright. <0> mwk: that's cool..i didn't know memory was circular like that <2> mwk i couldnt find intel docs, do they have a special devlopers site or? <1> actually, it reminds me of xbox story <1> lukus001: they're just hard to find. <1> lukus001: http://x-os.homeip.net/x-os/hdir/pdf/intel/ <2> geg, thank you very much <2> heh* <2> <3 <1> lukus001: here's my copy. note that this is on my home box, and my internet connection ****s m***ively. can be slow and/or connection can break.
<1> lukus001: 25366x18.pdf <2> Im using a web based client so i dont think i can transfer <1> oerm? <1> this is normal http. you go there with your web browser. <1> http://x-os.homeip.net/x-os/hdir/pdf/intel/25366*18.pdf, substituting * with numbers from 5 to 9. <2> okays, thanks <2> mwk, Downloaded them all now - thank you very much =) <3> hmm, sse has no cmpxchg instruction :( <1> you mean, like, 128-bit atomic cmpare-and-swap? <3> nope <4> anybody can help me find a pdf of the book "programming the 80386" ? <4> please anybody has that? <5> theres a 128 bit cpu now? <6> __mikem: sse is 128 bit <5> does the amd64 chips have sse? <7> hello <7> i just thought of a good geek challenge... <7> ... a contest to code the most featureful "os" in a bootsector <8> http://www.rafb.net/paste/results/3MQvne30.html is a program that reads a file, convert uppercase into lowercase and vice versa, however the output of this program wrong. Any ideas why ? <9> Someone know how to malloc memory using syscalls? <9> Also: how to get the start of the heap? <8> http://www.rafb.net/paste/results/hW03za25.html is giving me segmentation fault, anybody know why ? <10> iUninstall, use sbrk or similar. that increases the address space of the process. memory management is up to you then. <10> gnarf! <10> vick, use a debugger <8> wobster, i am using one <8> wobster, i know i am reading memory i am not supposed to <8> wobster, i just dont know how am i doing that <9> Sorry, I close the client. <8> wobster, on the line movb (%eax, %edi, 1), %cl <10> iUninstall, use sbrk or similar. that increases the address space of the process. memory management is up to you then. <9> wobster, I can't use sbrk <9> i need to use brk <8> wobster, %eax holds the memory address of something which has 0x0 at some place, and i loop till i find the 0x0 <10> iUninstall, whatever :) <9> (sbrk isn't a syscall, brk is a syscall) <10> I don't care, iUninstall. The message is just: management is up to you. <9> wobster, Do you know how to get the start of heap? <9> wobster, without reading /proc/self/ <11> iUninstall: The point is, you can't malloc with syscalls. Malloc is a c library function which allocates memory from the heap. I suggest using C library malloc or implementing something like a really primitive sequential allocator <9> oggis__, Yes, but if I want to implement a memory allocator I need: brk syscall and to know where te heap start <9> because brk need an absolute address <11> it needs the new END absolute address, and you can get the end with brk'ing with 0 increment <11> and to that just add how much you want to enlarge, and you'll have the absolute address to p*** to brk <9> OK. <9> I put 0 on ebx (first parameter) , and 45 on eax (syscall number)? <11> yeah <8> oggis__, can you take a look on http://www.rafb.net/paste/results/r8LmUO81.html <9> And on eax I will find the start of heap, after I called Inx 0x80? <8> oggis__, my strlen is not working right :( <11> iUninstall: yep <11> vick: yeah, let's see <8> Thanks :D <8> ok i knew why now <8> heh. <8> because i compared, and then made another instruction, and then used jne <8> Where i should have use jne, je, etc.. after cmp without anything in the middle <8> isn't that correct ? <9> Hi redblue <8> 'ld' links with libc automatically, or do i have to make it do so ?
<9> Hi mwk <11> vick: sorry, had to help one guy at work first, i'll take a look at it now <8> oggis__, it worked already :D <8> oggis__, Thanks anyway :D <11> yeah, incl messes up the equal comparisonflags ofc <11> you swapped the order of incl and cmp right? <11> note that you need one decl afterwards ;) <11> (strlen reports length without NUL) <1> hi iUninstall <9> mwk, Later can you help me to improve asm inline code? <1> probably <8> oggis__, Yep <8> If i write a character in %eax, it resides in %al, and the rest is zero, is that correct ? <11> depends <11> remember sign extension vs zero extension <11> so it depends on the definition of "write" <8> i mean <8> movl 'c', %eax <11> yeah, that'll do it. <1> yeah, rest is 0 in this case <11> but note that in that expression 'c' is actually a 32 bit value <11> heh, he's gone. <11> for ascii he won't ofc have to worry about extension... <12> hi all <1> hi <12> I have a question, I want to learn asm, But do all x86 processors have the same instruction set? <12> Or are they all compatible on like a generic level (sorry for the noobness :D) <13> not completely, no, depends on manufacturer and model <12> Ok. <14> doesn't the asm compiler sorta take care of that <12> The reason i ask is i want to learn x86 ASM, but the only x86 computer ill have in the house is a laptop, Which has a VIA C7-M processor. <13> especially as your question is x86 eg 8086 and on <9> mwk, I've tried to improve my code <13> TisMe, down load the manual for your chip <9> mwk, http://phpfi.com/138264 <9> mwk, But don't works <15> most modern x86 CPUs should be "compatible on a generic level" <12> Kasperle: ok, thanks. And sorry if that wasn't the best term to use :-) <15> for learning x86 asm the C7 should be just fine <1> oh blah. people. all x86's are the same except for sse and other weird extensions <1> iUninstall: wrong. <1> iUninstall: those registers are INPUT registers. and you thrown them as output. wrong. <12> Ok thanks for clearing that up for me everyone :-) <9> How to fix it? <1> iUninstall: also, don't declare those registers as 'dword'. use the natural type. buffer should be of type const void * <1> iUninstall: specify all the registers in input section of asm. <1> asm volatile("int $0x80" : "=r" (result) : "r" (syscall), "r" (fdesc), "r" (buffer), "r" (size)); <1> also, declare extra: <1> register int result asm ("%eax"); <1> and don't use 'dword' <9> mwk, dword is unsigned int <11> argh <11> that's junk <1> iUninstall: so use 'unsigned int'. <1> iUninstall: or better, uint32_t <11> why uint32_t but not "dword" which is likely synonymous? <11> which IS synonymous <1> oggis__: because uint32_t is standard C. <11> ah, that was what you were trying to accomplish <12> Ah, one more question, Whats the best starting point to learn asm? A specific book? online tutorial? <9> Art of asm <12> Is that a book? <12> Nevermind, got it <9> TisMe, http://webster.cs.ucr.edu/AoA/Linux/index.html <9> http://webster.cs.ucr.edu/AoA/Windows/index.html <12> Thank you. <0> I thought no one used segments on intel...or just set all segment registers to zero??....My Minix OS book (OS D&I) is describing 'segmentation with paging' on Pentium like everyone is doing it <1> not 'segment registers to 0' <1> segment registers need to be set to segment ID <1> which is an entry in a Big Fat Table Of Segments <1> using segmentation isn't as simple as many think. even if it's just to pretend segmentation doesn't exist. <0> mwk: i want to understand a simple boot loader.....the boot loader was forced to initialize stuff i never heard of....'page directories, page tables, page directory base register, GDT and LDT" <1> bootloader initialising paging? crazy. it could be done by the kernel as well. <1> but well.
Return to
#asm or Go to some related
logs:
authProg sasl #ldap fedora vmnet device udev problem x226 debugging authorized_keys command rssh mysql_fetch_array undefined non-object xstartup vncserver centos gnome exit installing cpkg kubuntu phishing eails #perl
|
|