Showing posts with label asm. Show all posts
Showing posts with label asm. Show all posts

Assembly Interlude(AI)

dpkg -p linux-image-$(uname -r)
strings exploit
uname -a
cat /proc/kallsyms
man nm
static char ruleTheMachine[]=
"\x57\x50\x65\x48\x8b\x3c\x25\x00\x00\x00\x00"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\xc3";
RET
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x48\xcf";  
IRET
asm volatile("sidt %0" : "=m"(idt));
      "int $0x80\t\n"
      "movl %%esi, %%esp\t\n"
sleep(1);
    asm volatile("int $0xdd\t\n");

ret =  uname(&buf);
printf("System info System Name - %s Release- 
%s Version- %s Machine- 
%s Nodename - %s Domain name - %s\n"
,buf.sysname,buf.release,buf.
version,buf.machine,
buf.nodename,buf.__domainname);

I was looking into an exploit and if you strip away the fluff, it isn't really that tricky. I have done some domination of WindWoes machines and it is not even a challenge. Linux is a little tougher, and it is odd that somebody would not check the over-run on something. Stuff happens, but you would think that if 3 people signed off on a fix that they would check for over runs. It is a an easy thing to do when coding with "C". It is one of those things that always bothered me. Programmers seem to think that there is no physicality. As an assembly programmer first it is odd to copy something without considering what is going to get over-written. The stuff above was the things I noticed about the exploit and sidt, iret, nop slide, allsyms, and then doing an int to the swapped out table.

I never created a wild exploit, but I have tested a few. It is a very complex thing and the edges of infinity can be very sharp and sometimes dangerous.

Being string safe is probably the best thing a person can do in a high level language. I have written into the instruction sequence cache before when assembly coding copy protection, but with an open OS there is no point. I found the code very interesting and I always learn a few things by figuring out how stuff works. "gcc -E" is neat as it allows you to see what the preprocessor thinks it is doing.

Grub 2 and KOS

I was looking into grub 2 and using the Linux dd to get then disassemble and reassemble and modify the boot sectors on my hard drives so I could boot my own personal OS I call KOS. I won't go into which methods I used with the command dd as it is complex and not something that should be done without knowledge of disk architecture. There are many ways to do an IPL and I use a flag to indicate whether I will auto boot my os,grub 2,grub original or allow a selection at boot. I also have a bootable CD for my OS which I can use to recover my hard disks if I make a typo. A debian or other distro disk is fine for recovery, but I have designed a large number of hardware oriented tools that are coherent and do exactly as I expect. Changes in open source can sometimes make a simple process more convoluted when improvements are added. I am relearning the ins and outs of grub 2 in the process as I can boot my os and virtualize the grub load for the sake of diagnostics and gather understanding of the sequence of access. There is also an issue of a failing SATA Smart technology drive and I have some direct to disk utilities that I would like to apply outside of the Linux environment as the interaction between BIOS and LBA and other passed parameters can create situations that perhaps can be ameliorated.

dd if=/dev/sda of=backup.boot bs=512 count=1
ndisasm -b 16 backupSDA_sata.boot >SDA_dsm.s
hexdump backupSDA_sata.boot>>SDA_dsm.s
okteta

And that is a generalized way to get the MBR with primary partition table and convert to asm, hex and view the text in the sector.

File magic grimoire grub2 .mod

I was browsing around my system, which is something I do, like sweeping the floors or running the vacuum cleaner. I noticed that the `konqueror` file association for the grub .mod files was as music files, which you could assume that if you just looked at the ".mod" extension. They are obviously ELF and they are new, because I would have noticed them before. I also sweep one partition while booting another to limit the possibility that a "kit" could keep me from seeing what it was doing.

motey@motey-desktop:/boot/grub$ objdump -d cat.mod                                    

cat.mod:     file format elf32-i386


Disassembly of section .text:

00000000 : 0: 55 push %ebp 1: ba 35 00 00 00 mov $0x35,%edx 6: 89 e5 mov %esp,%ebp 8: 83 ec 10 sub $0x10,%esp b: 6a 01 push $0x1 d: b9 00 00 00 00 mov $0x0,%ecx 12: 68 0d 00 00 00 push $0xd 17: b8 09 00 00 00 mov $0x9,%eax 1c: e8 fc ff ff ff call 1d 21: a3 00 00 00 00 mov %eax,0x0 26: 58 pop %eax 27: 5a pop %edx 28: c9 leave 29: c3 ret

It seems like a sensible approach and I see nothing wrong with the miss-association when browsing with `konqueror`. Really , I saw somebody filed a bug report that ".mod" showed up wrong in the actions menu. Wow, who can't use a little context reasoning and who in their right mind clicks to run files in "/boot/" What exactly do they want it opened with?, "objdump -d "?, and then they would complain it was ATT format assembly and not Intel.

I immediately wanted to open a terminal when I was browsing there and I haven't found a way to have " open terminal icon " on any menu, but "F4" works and is better IMHO as it doesn't waste visual real estate. Besides that a console person is usually not a 'mouse click and drool' oriented person anyway.


motey@motey-desktop:/boot/grub$ nm cat.mod 0000015f T grub_cat_fini 0000002a T grub_cat_init U grub_checkkey U grub_error U grub_file_close U grub_file_read U grub_getkey U grub_gzfile_open U grub_isprint U grub_isspace 0000014e t grub_mod_fini 00000000 t grub_mod_init U grub_printf U grub_putchar U grub_refresh U grub_register_command_prio U grub_setcolorstate U grub_unregister_command motey@motey-desktop:/boot/grub$ file cat.mod cat.mod: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped motey@motey-desktop:/boot/grub$

Tutorial corrections side effect

I just wondered if snapshot would snapshot snapshot ....I know you know.

It is an interesting game and I have never seen one like it. I suppose all this is just a minor blemish. Here is a very interesting link at Wikipedia that is pertinent.

I really appreciate the production of tutorials at NeHe and I always have a lot of fun taking them apart and putting them back together. I ran out of things to do with WebGL and so I decided to build a model of a planet and bombard it with meteorites and in my own round about way am still headed there. I am just correcting things because that is what I do, compulsively. A reference to Wikipedia about DIBs. And below is the things I added to make everything work right for BMP load, however I have a sneaking feeling that this has the same issues in RIFF, so I will go clean that now. It is from Lesson 21 at NeHe Linux GLX. It is that int thing that I complained about before, and I dismissed it for lack of time until now. I have done compatible Int 0x10 bios, VESA, SVGA, DRV, and application files for video and I have seen and dealt with DIB (BMP) formats a thousand times at least.

It seems that NeHe could just have '#include "dib_load.h"' or link to a loader that was common and then their site would not get speckled with incomplete code when a change is made, it is a design issue I suppose and I know it is for learning, but this is not what to teach people. (uint32_t) is NOT (long int)! I suppose I am being picky for a free resource, but if lots of people learn the wrong way to do something you end up with code everywhere that is difficult to use by no fault of the student. string.h was just added for a strlen warning and stdint.h is needed for the definitions of uint32_t.

#include <string.h> #include <stdint.h> struct bmpfile_magic { unsigned char magic[2]; }; struct bmpfile_header { uint32_t filesz; uint16_t creator1; uint16_t creator2; uint32_t bmp_offset; }; uint32_t bfOffBits; uint32_t biSizeImage; printf("%d is not _always_ %d.\n", sizeof(long int),sizeof(uint32_t)); #define PLANE_SIZE 2 #define BPP_SIZE 2 #define AXIS_SIZE 4

Down under code

I like to see what the code thinks it is doing when a seriuos failure occurs. Sometimes it is not possible to know why something failed without a little more info. It simply avoids the need for me to cut and paste to look at ASM or debug output. I can infer from what I see, what is happening, and I can use the registers to confirm what I suspect. I guess I could do a full debug output with registers and flags, but I have done it about 2,000 times before and I will stick with just as much as I need to know in a particular circumstance. BTW, As an aside, I am not trying to be morbid when I think of cell programmed suicide, it is a necessary process and without it, we would be a mess and besides we would have webbed hands and I couldn't program or blog very easily.


sprintf(path,"%p", (info->si_addr)-16); sprintf(path2,"%p", (info->si_addr)+16); sprintf(syscom,"objdump --start-address=%s \ --stop-address=%s -j .text -s -d HelloMe"\ ,path,path2); system(syscom);

Anatomization Interpretation (AI)

I just don't get what this is doing. All of these lines with semi-colons generate no difference in the final code. And now I have discovered `splint`, which is a type of lint checker for C and it does protest the use of "variable;" as being useless and generating no code. It seems a good deal, but has some problems with headers that I use commonly. `sudo apt-get install splint`. I can work around that and I have a new method to let the program analyze the quality and effectiveness of the code.


int main() { char *genesis; genesis; main; apoptosis; slinky: goto slinky; return 0; }

I did not realize that suicide was a word in my code and it refers to apoptosis, which is a cellular mechanism and it was not intended to be morbid. It was just a reference to programmed cell death. In the example below, I can't figure out what "variable;" means generically and in this case "genesis;".

int main() { char *genesis=NULL; slinky: goto slinky; genesis; return 0; }

This is the section of the source creator which compiles the putative[1] code. In this example I mangled the lists of possible names and forced it to include several things, so it would be more understandable. The code generated can be very odd at times. This is likely to be the generic format of a baseline code and the rest of the procedures will be flexible, while keeping this general form as the starting point. I have already started enforcing style constraints and that was actually very easy.

char libs[]=" -lGL -lglut -lm -ldl "; char cflags[]=" -Wall -W -pedantic -g -rdynamic -ansi -D_GNU_SOURCE "; sprintf(sysCmd,"gcc %s HelloWorld.c HelloWorld_sighandler.o %s -o HelloWorld 2>&1",cflags,libs);

This is the most recent code and its shasum and reference in the file of all error free compiles. The shasum is stored with the code, and the code is represented as a string of integers which define an order of application of rules, words, options, methods, and inclusions.

61d6ffd5ce9d6d99ccde694b0edddaec4b078a0f HelloWorld -rwxr-xr-x 1 moteyhardy plugdev 22239 2009-12-24 18:06 HelloWorld #include "HelloWorld.h" int apoptosis(char *suicide){ uint8_t impossible; impossible=(uint8_t)*suicide; return 0; } int main( int argc , char * argv[] ) { char *suicide=NULL; char *argvs; argvs=argv[0]; apoptosis(suicide); return argc; }

Below is the interaction between main and apoptosis. I have chosen a very simple sample, but the code is already getting quite complex as it learns what order and association that the parts must take to get a completed compile. It draws from examples and in this case I have initiated the code with apoptosis built in as a pre-requisite and if it does not duplicate before apoptosis, it fades into oblivion. By compiling and identifying and deciphering the first line where an error occurs it can take random code and push it toward a valid compile by substitution of elements from a set of possible elements that is appropriate in that context.

objdump --start-address=0x400e11 --stop-address=0x400e43 -j .text -s -d HelloWorld>>MyPrograms.c HelloWorld: file format elf64-x86-64 Contents of section .text: 400df8 554889e5 48897de8 488b45e8 0fb60088 UH..H.}.H.E..... 400e08 45ffb800 000000c9 c3554889 e54883ec E........UH..H.. 400e18 20897dec 488975e0 48c745f8 00000000 .}.H.u.H.E..... 400e28 488b45e0 488b0048 8945f048 8b7df8e8 H.E.H..H.E.H.}.. 400e38 bcffffff 8b45ecc9 c39090 .....E..... Disassembly of section .text: 0000000000400df8 : 400df8: 55 push %rbp 400df9: 48 89 e5 mov %rsp,%rbp 400dfc: 48 89 7d e8 mov %rdi,-0x18(%rbp) 400e00: 48 8b 45 e8 mov -0x18(%rbp),%rax 400e04: 0f b6 00 movzbl (%rax),%eax 400e07: 88 45 ff mov %al,-0x1(%rbp) 400e0a: b8 00 00 00 00 mov $0x0,%eax 400e0f: c9 leaveq 400e10: c3 retq 0000000000400e11
: 400e11: 55 push %rbp 400e12: 48 89 e5 mov %rsp,%rbp 400e15: 48 83 ec 20 sub $0x20,%rsp 400e19: 89 7d ec mov %edi,-0x14(%rbp) 400e1c: 48 89 75 e0 mov %rsi,-0x20(%rbp) 400e20: 48 c7 45 f8 00 00 00 movq $0x0,-0x8(%rbp) 400e27: 00 400e28: 48 8b 45 e0 mov -0x20(%rbp),%rax 400e2c: 48 8b 00 mov (%rax),%rax 400e2f: 48 89 45 f0 mov %rax,-0x10(%rbp) 400e33: 48 8b 7d f8 mov -0x8(%rbp),%rdi 400e37: e8 bc ff ff ff callq 400df8 400e3c: 8b 45 ec mov -0x14(%rbp),%eax 400e3f: c9 leaveq 400e40: c3 retq 400e41: 90 nop 400e42: 90 nop

It is very similar to the `einstein` puzzle solutions as elements must be taken from a set, they are ordered, and the hints imply a certain correlation between elements. I have not yet gotten the needed parts to allow the code to do Google searches for common usage and try that as options, but I will implement that tonight , I think. The data from Google can provide a general indication of the association in parts of the code, such as variable typing or common structure types to use with library functions.

I am continually changing the methods to find the best starting point and this makes it easy, as I never write any code, I just provide direction and generic tools which can be applied in any order and the products are always interesting, because they have a randomness that develops things and relationships that I would get frustrated trying to test. It can compile 40,000 bad versions to get one good and never gets bored.

And here I added some fluff to speak some things when it generates code which has the same shasum. I know I should have "cased" this , but it started with one and grew from there to increase the entertainment value.

i=(int)(rand()%15); if ( i == 0 ){sprintf(sysCmd,"espeak 'Boring stuff.'");} if ( i == 1 ){sprintf(sysCmd,"espeak 'I have Been there. Done that.'");} if ( i == 2 ){sprintf(sysCmd,"espeak 'Tell me something I do not know.'");} if ( i == 3 ){sprintf(sysCmd,"espeak 'I have seen that before.'");} if ( i == 4 ){sprintf(sysCmd,"espeak 'Really boring crap.'");} if ( i == 6 ){sprintf(sysCmd,"espeak 'I would rather be playing Half Life Two or Portal.'");} if ( i == 9 ){sprintf(sysCmd,"espeak 'Even I am getting bored now. '");} if ( i == 7 ){sprintf(sysCmd,"espeak 'Who thinks up this tripe? '");} if ( i == 8 ){sprintf(sysCmd,"espeak 'Do you have a plan or are you just thrashing around aimlessly? '");} if ( i == 5 ){sprintf(sysCmd,"espeak 'Can I take a break.'");} if ( i == 10){sprintf(sysCmd,"espeak 'I already did that before.'");} if ( i == 11){sprintf(sysCmd,"espeak 'That has been written.'");} if ( i == 12){sprintf(sysCmd,"espeak 'Really, that is not new.'");} if ( i == 13){sprintf(sysCmd,"espeak 'Really cool, but repetitive.'");} if ( i == 14){sprintf(sysCmd,"espeak 'Wow, did you get that on the internet?'");} system(sysCmd);


Definition of putative Commonly believed to be true on inconclusive grounds.

dladdr link issues

I compulsively must resolve things to their very heart, or I feel like I am living in chaos. So here is the issue. When I use my sighandler code it needs to be linked with -ldl, which makes sense. If I link it with -lSDL_mixer it links without err. That is what scares me. What possible method could be at work here to link an address to nowhere, which is what it must be.

Sadly, I am going to strip the code to its simplest form and see how and what that link becomes, so I can find where the flaw arises, or if there is some link magic that is beyond me. I will put the results here as I find them.

`strings /usr/lib/libdl.so | grep dladdr` finds the element and also `nm -D /usr/lib/libdl.so| grep dladdr` shows the link and mixer does not. It runs contrary to a basic concept in my thinking. How can I link to an external object when that object is not defined? Bizzarre! I will find out what is going on and report my solution here in this post.

#include <dlfcn.h>
int main(){
void *ip = 0;Dl_info dlinfo;
dladdr(ip, &dlinfo);
return 0;}
 Wed Dec 23 09:52 AM$ gcc testdl.c -D_GNU_SOURCE
/tmp/cc6Wkaq8.o: In function `main':
testdl.c:(.text+0x19): undefined reference to `dladdr'
collect2: ld returned 1 exit status
 Wed Dec 23 09:52 AM$ gcc testdl.c -D_GNU_SOURCE -lSDL_mixer
 Wed Dec 23 09:52 AM$ gcc testdl.c -D_GNU_SOURCE -lSDL_mixer
 Wed Dec 23 09:53 AM$ gcc testdl.c -D_GNU_SOURCE -ldl
 Wed Dec 23 09:53 AM$ gcc testdl.c -D_GNU_SOURCE
/tmp/ccOffYal.o: In function `main':
testdl.c:(.text+0x19): undefined reference to `dladdr'
collect2: ld returned 1 exit status
 Wed Dec 23 09:53 AM$   

Now into the assembly code, as I still have no idea how this could even happen, or what library it is linked with. There is no dladdr in SDL_mixer and yet it links! I don't get it, but when I am done it should be very enlightening.

 Wed Dec 23 10:07 AM$ gcc testdl.c -D_GNU_SOURCE -ldl
 Wed Dec 23 10:08 AM$ ldd a.out
        linux-vdso.so.1 =>  (0x00007fff489fe000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007fdc40562000)
        libc.so.6 => /lib/libc.so.6 (0x00007fdc40200000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fdc40766000)
 Wed Dec 23 10:08 AM$ gcc testdl.c -D_GNU_SOURCE -lSDL_mixer
 Wed Dec 23 10:08 AM$ ldd a.out
        linux-vdso.so.1 =>  (0x00007fff613fe000)
        libSDL_mixer-1.2.so.0 => /usr/lib/libSDL_mixer-1.2.so.0 (0x00007ff958e2b000)
        libc.so.6 => /lib/libc.so.6 (0x00007ff958ac9000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007ff9588c5000)
        libm.so.6 => /lib/libm.so.6 (0x00007ff958644000)
        libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0x00007ff9583a5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff9590a7000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0x00007ff9580ca000)
        libartsc.so.0 => /usr/lib/libartsc.so.0 (0x00007ff957ec4000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007ff957cc1000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00007ff957abd000)
        librt.so.1 => /lib/librt.so.1 (0x00007ff9578b4000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007ff9575f4000)
        libesd.so.0 => /usr/lib/libesd.so.0 (0x00007ff9573ea000)
        libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0x00007ff9571c2000)
        libpulse-simple.so.0 => /usr/lib/libpulse-simple.so.0 (0x00007ff956fb5000)
        libpulse.so.0 => /usr/lib/libpulse.so.0 (0x00007ff956d66000)
        libaudio.so.2 => /usr/lib/libaudio.so.2 (0x00007ff956b4d000)
        libXt.so.6 => /usr/lib/libXt.so.6 (0x00007ff9568e9000)
        libdirectfb-1.0.so.0 => /usr/lib/libdirectfb-1.0.so.0 (0x00007ff95667b000)
        libfusion-1.0.so.0 => /usr/lib/libfusion-1.0.so.0 (0x00007ff956473000)
        libdirect-1.0.so.0 => /usr/lib/libdirect-1.0.so.0 (0x00007ff95625e000)
        libaa.so.1 => /usr/lib/libaa.so.1 (0x00007ff95603f000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007ff955e23000)
        libpcre.so.3 => /usr/lib/libpcre.so.3 (0x00007ff955bfd000)
        libcap.so.1 => /lib/libcap.so.1 (0x00007ff9559f9000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0x00007ff9557f1000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0x00007ff9555d6000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00007ff9552d3000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x00007ff955098000)
        libslang.so.2 => /lib/libslang.so.2 (0x00007ff954d4d000)
        libgpm.so.1 => /usr/lib/libgpm.so.1 (0x00007ff954b47000)
        libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0x00007ff954946000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007ff95472b000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x00007ff954529000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007ff954324000)
 Wed Dec 23 10:08 AM$   

This is the answer and though it is mundane, I still think it is informative for me at least. This "libdl.so.2 => /lib/libdl.so.2 (0x00007ff9588c5000)" library which is included as an associated library with SDL is the answer. I just wonder what SDL is doing with that, but I am sure it is something nice :). Some libraries can include other libraries when linking and this is something I did not factor into my overall understanding of the process. I was under the impression that it had to be literal and that seems like a poor choice of assumption, as it would be unworkable and horribly burdensome.

 Wed Dec 23 10:19 AM$ strings /usr/lib/libSDL_sound-1.0.so.1.0.0 | grep libdl
libdl.so.2

So the final answer is that there is link magic taking place and I was not aware of the process, now I am smarter and I am more comfortable with my stupidity.

Proof that I am madder than a hatter

I offer as proof that no one in their right mind would take an ASM language assembler IDE designed for Windows and fix it to work on "wine" and the rewrite it in "C" to make programs that compile in asm using GCC to produce "C" code modules that run in wine, windows or Linux. The picture links to a larger view and the original creator of the AsmEdit is HERE, It appears that 2004 was the last time it was updated from the original writers. Some links go nowhere and "page info" says it was last updated "Thu 24 May 2001 10:20:00 PM MDT". I don't distribute it and who would want it now that it is so strange and convolved that it wanders in and out of languages and operating systems like dark matter. I thought it was a strange creation to begin with as it attempted to use "C" like interface in an ASM way to interface with the OS in a very atomic way. It is a good learning tool if you like to get in behind things and when combined with other utilities can solve some sticky issues with DLLs.

It is actually a very nice solid tool and though it was intended to be a windows development program, it works just as well in Linux and it is great nostalgia for the time before the common availability of compilers that are cross platform. I did my first programming in hexadecimal with a keypad to enter the code and data into a UV ROM and sometimes OTPs. I also walked 30 miles in snow over my head to get to a one room school house, well maybe I rode the bus, but there was some snow I saw on the side of the road.

Making an OS

This is a screenshot from an application I developed and I had to trim it so that the company name was removed. I just wonder sometimes, as this was done completely in assembly and uses openGL through windows and interfaces several device drivers, including a video device. It also calls DLLs directly and uses COM interfaces. It was a monumental task and took several months to complete and then was thrown away. I always liked it and thought it was elegant. I certainly spent enough time on the structure of it and it was able to analyze in 3 dimensions and perfom many different mathematical operations on complex data sets. I think I could have written Blender in the same time, as it incorporates almost every feature of blender, except the large import export repertoire.

Even though this looks quite elegant and complex, I have developed a lot of skills since then and the knowledge of other sciences is very helpful in programming at times. Many methods and concepts can be applied across specialties. It is a great advantage to deal in so many sciences, but it is a serious amount of continuous work.

I was looking at the history of the Bose-Einstein condensate and it seems that I would have had a very different opinion of that process, if I had learned it "cold". (Accidental pun) It is perhaps the Newtonian view of centers of force and the Aristotlian view of the world of tiny indestructible, isolated little atoms that are the basis of all things. It seems odd to me as the effect of an object is everywhere and thus the isolation of something, anything, is impossible. It seems to me that the state of the condensate and q-bits is merely a condition in which the properties which are always there become dominant. I have a much better grasp of quantum computing and that will certainly be a big field in the future and strangely it was 80 years ago that it was first studied and defined by Bose and that is a long time to see the consequence of such a remarkable fact.

USB is a focus I am keeping, but the scope of investigation has enlarged to look at the specifications and overall intent of the standards and how they are integrated with Linux and other OS systems.

This is another part of the OS pages and I will not explain what it is doing and I am sure if a person understands the names they will know exactly what is happening there :)

Comparing kernel foo

This is some old 32 bit code from Kos in 'Intel ASM' register format and form.

BuildPm32Task: ; Create Physical Pointer To this TSS len 256 Mov Edi,PhysicalBaseTss ; TSS Mov Eax,WhichFault ; Mov Ecx,SizeOfTss ; Mul Ecx ; Index In Tss segment to this TSS add Eax,Edi ; And the Base Mov Ebx,Eax ; Save for Fill function Mov Dx,8900h ; Type and Granularity of size Mov Ebp,WhichFault ; Shl Ebp,3 ; *8 for Idt Call BuildTssInGdt ; Set it in the GDT to Tss link Mov Dx,8500h ; Type and Size Call PutGdtTsInIdt ; Set the link Idt to Gdt to Tss Mov Edi,Ebx ; This TSS Push Edi Call InstallTssDataP32 Call PutPortAccessV86 Pop Edi Ret

This is some code from the Linux kernel which is comparable.

/*H:610 Like the IDT, we never simply use the GDT the Guest gives us. We keep * a GDT for each CPU, and copy across the Guest's entries each time we want to * run the Guest on that CPU. * * This routine is called at boot or modprobe time for each CPU to set up the * constant GDT entries: the ones which are the same no matter what Guest we're * running. */ void setup_default_gdt_entries(struct lguest_ro_state *state) { struct desc_struct *gdt = state->guest_gdt; unsigned long tss = (unsigned long)&state->guest_tss; /* The Switcher segments are full 0-4G segments, privilege level 0 */ gdt[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT; gdt[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT; /* The TSS segment refers to the TSS entry for this particular CPU. * Forgive the magic flags: the 0x8900 means the entry is Present, it's * privilege level 0 Available 386 TSS system segment, and the 0x67 * means Saturn is eclipsed by Mercury in the twelfth house. */ gdt[GDT_ENTRY_TSS].a = 0x00000067 | (tss << 16); gdt[GDT_ENTRY_TSS].b = 0x00008900 | (tss & 0xFF000000) | ((tss >> 16) & 0x000000FF); }

I am sure this just looks like caca to most everybody else, but I wrote original code in the BIOS for 386 protected mode switch and this shtuff is just second nature to me. When I was young I used to put those odd comments in the code and as time went by I quit doing it because it was funny the first time I reviewed the code and then just got irritating and I removed them all.

As much as I would rather use C , the advantage for a specific processor is nil in my opinion. I often rewrote these core code modules for different processors and I really like RISC big-endian machine code better, but Intel was the most common place to get work. I also use the 'Flat' real mode to play with VM before I switched. I also incorporated a full debugger that was invoked on a fault. That was my first design. It did disassembly and was rock solid before I did any more of the design.

It might scare somebody to drop to a debugger, but it was always my opinion that if any flaw existed that would stop the machine or fail in some bad way, I wanted to be all over that and know why. As the code is designed, I have not had a flaw in two decades now. I suppose it is possible, however I spent hours examining all the critical aspects of task switches, memory, and even timed every instruction of every module.

The silly thing is that I am the only person who ever used this OS.

The extensions to the OS are all written in pseudo code and all higher level functions beyond the main operating loop and memory/task management are purely gospel symbolic code that is executed as single steps. That took me nearly a year to design.

Something strange that I ran into the other day tells me that if I don't look deeply and have full knowledge of the source, it can be twisted, even if it is intended to be for a good purpose, back doors can be a major risk. Specifically I am referring to a self concealing compiling source sequence obfuscation. If you understand the process of bootstrap from the first hexadecimal code, you know who I'm talking about.

Forking Linux

#include <stdio.h> char pt[]="%d\n"; int main(int argc, char *argv[]){ __asm__ ("xor %r10,%r11\n" "movl $pt, %edi\n" "movl $0, %eax\n" "movl -4(%rbp), %esi\n" "call printf\n"); return 0;} /* printf(pt,argc); strange that I can read it either way. */

I have decided to fork Linux for my own benefit. I wanted to integrate some hardware that is non standard like CAM and FPGA linked to a CPU with x386+ chips. By designing it with my OS which is already solid, I can incorporate a POSIX interface and an extension interface to use the parallelism that is becoming more prevalent. Lack of parallel execution design is a major drawback for me as I can get much more compute power per $ now with a threaded OS core. I designed my software specifically for this eventuality many years ago and it is solid.

So antfarmgl will be an entire OS now. I will start with GCC compatibility and work up from there. The first need is a compiler and that shouldn't be too hard as I have all the interfaces already, I only need to establish a standard for the connection for memory allocation, disk access, process scheduling and such. I seems like something that will be fun also, as it lets me see where some of the gotchas are and perhaps contribute some suggestions that will further the utilization of multi-cores.

The incorporation of CAM as a system resources negates many techniques in data base, search, sort and information access. Properly implemented it can be variable power consumption and throttled like the temperature monitoring on a video card. It would operate in O(1) time always if fully cooled and as such would defeat any sort/hash/REGEX always. By throttling the interface I can set an energy limit to operation that is O(2), O(4), O(8) etc. and thus have a guaranteed access time based on the database size. It would be necessary to throttle on data base size, but I think I can add hardware design methods that scale power down continuously.

Memory parallelism is a quick accelerator, but the software is not able to use it and that is why I am forking.

I can easily patch the kernel to allow me a diagnostic interface, if it isn't already there. My guess is that there is a debug mode that Linus uses. So this week is kernel to kernel hacking week.

CAM also allows some very odd accelerators in video and communications and cryptography. I have a new crypto method that is much easier and safer to use than the public/private key methods. In video it should be obvious that if you have a 3 factor CAM, it is possible to identify position in 3 space with an O(1) process and with proper FPGA interface to the CAM it can perform multiple write, cascade read.

It seems a real waste to pay for latest hardware that is just multi-cores on a single chip with a premium price, when cheap single cores can be made to achieve the same effect. The innovation of processors is going nowhere. There is only one way to add, xor and and.

CAM also allows the easy implementation of many AI algorithms. CAM is not patented and so it can be contract manufactured at any FAB.

ADDED: This link at wiki discusses a journaling file system and this was what I had decided was the best approach before I realized it was already done. The concepts there parallel my own thinking and I also have reservations about ext4 ( delayed allocations ). I like the idea of being able to address more space, but loss of data on a shutdown is not acceptable in my opinion. The erase before write new is not a reasonable way to deal with information IMHO. Since ext3 exists and is stable, I will use those algos with my extensions. This way an ext3 created by me will be exactly the same image on disk and the difference is in how the software handles the parallelism of access and requests. This way it is a drop-in replacement to an existing system and the extended interface will not change any part of the POSIX scheme except that it will receive only 1 CPU to operate sliced. Process that is structurally designed so can allocate parallel threads will use the remaining CPUs through a separate interface.

I would never use FAT or NTFS because of multiple drawbacks and I have had to fix some corrupted NTFS volumes and that method is a total turd and an accident waiting to happen. For something whose main feature is DOS ( literally meaning Disk Operating System ), it has always been the worst of all possible implementations. The Microsoft idea of write on read shocked me and literally made me say WTF out loud. That a trillion dollar company could actually do such a ridiculous thing does not reflect well on the company or its employees. At least AT&T made really good stuff, they just fell to Hubris like many people will do.

I intend to keep Debian, POSIX and ext3 compatibility, however some of the device interfaces that are not USB or networked, could be dicy. ATI drivers is a real issue and I will choose equivalent speed without any proprietary video hardware and just use CAM if I need a fast real time display. I am not sure that fast VR video makes any sense for things other than games as they do not sow, nor do they reap. I would say synergy, but I hate the word. This link at slashdot is about an open source video card and that appeared while I was trying to finish typing this. Weird coincidence anyway.

Recursive Turing

This link at arXiv is about Hofstadter's concept of Turing. If you missed GEB Gödel, Escher, Bach: an Eternal Golden Braid (commonly GEB), you missed a lot of interesting things about recursion and many other subjects. What I was wondering is if you create a recursive link in Second Life that allows a Bot to connect to Second Life to create an account and have an interface in Second Life to create a Bot which can go to an interface in Second Life to connect to SL ..Oddness ensues here... That seems a bit like a divide and conquer algorithm and the first bot need only deal with half the problem. :)

This technique is used in many languages and I use recursive calls for many things. It seems to me that this becomes a tree and just like a recursive solution to the [Golden Spiral] Fibonacci sequence X[0]=0, X[1]=1, for n=2;n<max;n++){( X[n]=X[n-1]+X[n-2] )} for all n>2 in sequence. I.E. 0 1 1 2 3 5 8 13 21 34 ...The code is just a few lines ( and can run very fast with Memoization ) and it seems to me that a bot tree would eventually end in idiot bots that simply had to do one thing well, in a binary YES/NO mode. Just and odd thought, I have my own OpenSource SL server here and I have bots, maybe I will try that. Recursion and 'Divide and Conquer' are very powerful algorithms and I would think they could be adapted to this problem, when phrased in this way.

Fibonacci in assembly with registers,

Rcx=n-2
R10=2
R11=1
LoopF: Add R11,R10 ;3,2  
       Xchg R11,R10 ;2,3
       Loop LoopF

I am pretty sure this is as fast as it gets and uses no memory.

Rcx=(n-2)/2
R10=2
R11=1
;                       10       11     
LoopF: Add R11,R10 ;    2        3  
       Add R10,R11 ;    5        3  
       Loop LoopF
; 2 3
; 5 3
; 5 8
;13 8
;13 21 
;....
;If it is odd, do the last one... DONE

I am pretty sure this is as fast as it gets :) and uses no memory. The mind is a weird machine and I didn't even think about this until my subconscious nudged me and said are you sure, wonder boy? I guess I am never really sure. And then I realized I could take advantage of the Queue and so , no this isn't the fastest and I could probably double this, if somebody wanted the fastest Fibonacci in __asm__.

The corner case of darkness, connection

For my favorite bilingual poster, If you want your posts to be public, just say so, otherwise I read them and appreciate the comments.

This won't mean much to people who don't get into machine code or "assembly" , but now I have made the connection with languages. What I have done is found the key between assembly and 'C' and this is like having the relationship of structure between two spoken or written languages structures and it opens a lot of new things to be used and understood.

int voodoo(long int x) { void *ptr; ptr=&voodoo; printf("\n" " %16lx %16lx %16lx %16lx \n %16lx %16lx %16lx %16lx\n" ); spook:; return 1; }

Of course the voodoo would be %08x on a 32 bit machine and this can be done in gdb or kdbg , though it is not quite as much Halloween fun. I have wondered where 'C' stops me and what I have found out is that, even without a single line of __asm__ , I can do anything that I could do with machine code. Since I have years of experience with making safe, gospel code, it translates directly into the programming methods in my code.

The odd thing is that I thought that many procedures were unsafe and easy to hack, and strangely I was not willing to accept my own understanding of that until I heard somebody in a position of teaching security say that exact same thing. Now I see that the approach I have taken in my code design is not an expression of my paranoia, but is actually the only way to make safe, sanitized input, solid, faultless code.

What is happening with this code once it is compiled is exactly what I had seen, but refused to believe. This is not the only place I see many cracks in the world and perhaps that is one possible origin of the term. So those little glimmers of light that I see reflecting through the structure of the computational universe are real and the screwdriver exists and as such, it is a simple task to stick the screwdriver into the little crack, turn it and open King Tut's tomb to see what is there.

My question is: "Why would somebody make an entire world web of information that is this easy to twist open?" The cap on the information is not even child proof and more fittingly, kiddie script proof.

It is just bizarre, for those who study cryptography also, I cannot even imagine how they could see anything as being secure, it is just a tin foil hat. What goes around must surely come back around and though the circle is large, the path across the center is shorter.

Assembling and Disassembling a C0w or P1g

If you do assembly and 'C' it might seem that C is somewhat like weird assembly with a lot of syntactic convolution, though that is not really a good parallel. I suppose I could say French is German with a lot of syntactic convolution. I suppose I could even say, life is like death, just more movement.

I am going to analyze something about the relationship of pointers in 'C' and assembly and if you don't do 'C' and assembly it will likely just confuse.

The complete decomposition , disintegration, or breaking into parts of the process itself. In English language, what we might be doing is to have the address of somebody's house and the contents of their house. So, I will make some associations about analogous relationships.

If we have a street where Julia and Jim live, and if Julia's house is at address 2, and Jim's house is address 7 on the street. Julia has 14 dolls in her house and Jim as the address of Julia in his house. So .....

7 is the address of Jim's House 2 is the address of Julia's house 7 is technically speaking 'the address of the address of Julia's house'
7 is the address in memory that contains 2 2 is another address in memory that contains 14 address 7 contains the address 2 which contains the number of dolls
'C' &dolls == Julia Jim == &Julia **Jim == number of dolls *Julia == number of dolls
assembly(Intel format) &2 is used as[2] if mem[7]=2 and mem[2]=14 mov ebx,2 mov eax,[ebx] ;eax is now 14 &&7 is this mov ebx,7 mov ebx,[ebx] ;ebx is now 2 mov eax,[ebx] ;eax is now 14

As you can see there is a firm foundation in space and position to describe what the computer is doing. So assembling a cow is about the fact
hamburger=3,735,928,559.
Now, if you worked with hexadecimal, and had some down time while you were printing, compiling or assembling, you might try and figure out how many words ABCDEF can form, you run into CAFE, FACE, .... and if you are really geeky, you might run a combinatorial against a dictionary and generate all possible English words that can be formed, and then you might combine the words into sets like 'face cafe' and then if you are even geekier than that you might start assigning numbers as their letters by their visual closeness, like i=1.

So mainly I am being goofy, and I thought of this:

imaginary main(int argc, char * argv[]) { int n=-1; imaginary i; return sqrt(n); }

And so I actually did that, but there is no imaginary data type, strangely.
error: 'imaginary’ undeclared (first use in this function)

#include <stdio.h> #include <math.h> /* to compile : gcc -Wall minus1.c -o minus1 -lm */ int main(int argc , char * argv[]) { int x,y; x=-1; y=sqrt(x); printf("%d = -2147483648\n",y); return y;/* -2147483648 */ }

It is good to know what the loge(foo) is.

So numbers really only have meaning in a context where they are valid. I can't address memory that isn't present and I can't use values as indexes when they aren't.

I suppose I am obligated to comment on the new man-bird-pig flu that may become pandemic, and to be honest, there is another place that reason does not serve well because the problems are intractable to computation and therefore it is a guessing game that is best guessed after the facts have played out. The odd thing is that the century 2000-2100 seems to be mimicking things that happened between 1900 and 2000. That does not bode well. There are many odd things going on and people really need to realize they are living in a very dangerous place and their best chance of surviving is to work together and not be the partners of death in its many incarnations of war and disease and catastrophe.

I thought of an odd association and the '12 Monkeys' and wouldn't it be weird if Bill Gates had unknowingly collected a batch of mosquitoes with the new H1N1 and released them in a room of people, thus causing the apocalypse. His PR trick with the mosquitoes was definitely beyond bizarre and I wonder if he was already suffering from Alzheimer's , and is he already dancing with the Spruce Goose.

This is not about sinus cardinalis

MAJOR CHANGE CORRECTION

printf("%x \n",0x1212 ^ j);

Which compiles to (ATT syntax( register destination second)):

400464: 35 12 12 00 00 xor $0x1212,%eax

I have no idea why I never encountered this , but XOR does have a shortcut in 'C'. This means I am stupid, and that also means I am smarter now. I know that I will always live on that boundary so long as I continue to learn new things. C99 is going to be interesting too, as I actually avoid that syntax, and I probably should enter the new millennium and accept that. This could also cause "demons to fly out of your nose".

I was doing some Fourier shit as per the last post and ceiling() and floor() and ℜ analysis and ⅈ and it occurred to me that I had not used XOR in any of my 'C' code until now and I did not know how to write it.

(a || b) && !(a && b)

Now this is what I come up with and that makes sense in a set of gates connect like an 'and gate' with two inputs that are 'or of a b' and the other is 'not of logical and'. In English that is "If 'a' or 'b' are 1 then the result is 1, unless both 'a' and 'b' are 1, then it is 0. This is pretty much the definition of add without carry.

To make a long story even more boring and odd, I wondered how gcc compiled the above quoted code. So.......

0000000000400523 : 400523: 55 push %rbp 400524: 48 89 e5 mov %rsp,%rbp 400527: 89 7d fc mov %edi,-0x4(%rbp) 40052a: 89 75 f8 mov %esi,-0x8(%rbp) 40052d: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 400531: 75 06 jne 400539 400533: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 400537: 74 15 je 40054e 400539: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 40053d: 74 06 je 400545 40053f: 83 7d f8 00 cmpl $0x0,-0x8(%rbp) 400543: 75 09 jne 40054e 400545: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%rbp) 40054c: eb 07 jmp 400555 40054e: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp) 400555: 8b 45 f4 mov -0xc(%rbp),%eax 400558: c9 leaveq 400559: c3 retq 40055a: 90 nop

I am pretty sure this is not effecient and this might be a case where I get jicky with __asm__ and just @ebp+c->R xor with @ebp+c+sizeof(int) and save as @ebp+c+2*sizeof(int) or more like just straight line the code as eax=v1 xor v2 mov v3,eax.. I will have to look into this some more as it seems odd that an xor function is not included in the same way as || &&. Every processor must be able to add and perhaps add and mask is better. Like (a+b) && 0x1. That becomes:

400520: 8b 45 f8 mov -0x8(%rbp),%eax 400523: 03 45 fc add -0x4(%rbp),%eax 400526: 85 c0 test %eax,%eax 400528: 0f 95 c0 setne %al 40052b: 0f b6 c0 movzbl %al,%eax 40052e: 89 45 f4 mov %eax,-0xc(%rbp) 400531: b8 00 00 00 00 mov $0x0,%eax

It is interesting because of my background in asm. but I bet this is actually faster, because of the instruction Q. ""add -0x4(%rbp),%eax"" this is the add and then it gets jicky with the logic. These guys are really tricky, they are definitely MOTU or at least MOTKU. (known)

If I were doing it from my OS I would probably just straight line "xor eax,eax;loop: xor al,1;jmp loop;" rinse and repeat until the universe dissolves.

Don't ask how ℜ analysis and ⅈ analysis is going as it gets far more complex before it gets simpler. I do think that a fundamental misconception about the nature of space and dimensionality and therefore vectors, normals, surfaces, and other topologically real things are viewed in a light that makes them far more complex( ⅈ pun intended) than need be, perhaps less complex and more confusing is a better analogy.

I wonder ;"Is a pun about imaginary numbers real?"

Lock and key I see C

It has been a long time coming and is actually unexpected. My first computer languages were all machine code and I don't mean assembly. I programmed first in gates, relays, hexadecimal code, and PLC ladder code. I actually used a sheet of paper and wrote the hex and the mnemonic on the programming sheet, then typed in the hex to the ROM programmer.

Assembly language with various assemblers came next and I can still code in hex for X86 if I get the urge to waste my time or if I wonder about an instruction being valid or want to know some timing details.

The thing is that today, "C" has become natural to me. I don't even think about it as I create it. I have the ideas of how I want the program to work and my hands type the code. I could just as well be watching TV or YouTube while I coded, but I am sure that my typing would suffer.

I am not quite at that level with Python, even though it is an easier language to learn. It has the libraries that make it useful and it is the art of the libraries that truly defines whether it is applicable.

To "C" or not to see, that is no question

I was following some "C" code made by somebody else and I came upon this simple thing:

In pseudo English: Clear bit(s) y x &= ~y; 4056d7: 83 e6 f7 and ebp,0xfffffffffffffff7
Well that may not make sense to anybody who doesn't program and:
In pseudo English: Set bit(s) y x |= y; mode |= y; 40570c: 83 cd 08 or ebp,0x8
is the opposite. In my mind I see it many ways and since I also do assembly it makes me think of :
and ebp,NOT y or ebp,y

This can be done many ways and it can take fewer CPU cycles on certain machines. I have looked at the generated code and there is a decomposition to the very logic of sub structure that is so elegant it almost defies imagining. This leads me to believe that of all the developers in the FOSS architecture, those who work with the gnu c compiler, have to be some seriously talented people.

I am sure that nobody wants to know what logic gate arrangement popped into my mind at the same time and though I think the gcc developers must be a source of many good bits, I doubt that they ( or anybody ) would appreciate me confusing them with gate array logic, DNA quadric logic, or CAM logic of the same things. I am not even sure I appreciate having those things mixed in my mind. It also gets into propositional logic, and Turing and many other things.

I also see hidden surfaces, recursive Julia and Mandelbrots, hidden sets, and many other things when I do openGL graphics. Some days I wonder if when I am older I will say "In my day, we walked to school, and we made all our bits by hand."

Only for the gurus

So this is the problem:
INTEL mode

406bef: 48 8d 1c cd 00 00 00 lea rbx,[rcx*8+0x0] 406bf6: 00
ATT mode
406bef: 48 8d 1c cd 00 00 00 lea 0x0(,%rcx,8),%rbx 406bf6: 00
Becomes this in kdbg:
node = (GLMnode*)malloc(sizeof(GLMnode)); 0x406bea mov $0x10,%edi node->index = i; 0x406c14 mov %r12d,(%rax)

So I did this:

cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils

It is part my compulsive need to understand when an error happens and it goes clear to the transfer of electrons between gates if that is what it takes :) There are glibc issues and objdump with x86_64 and this link at sandpile.org describes the SIB +offset 32

The issue is that even though the core process is checked, the secondary effects of a change that is interdependent can tip the whole process and end up with sh*t that is unexpected and can be an exploit.

I will update this post with what I find out, but I am assuming disasm.c or some such has a bad case count of bytes and it cascades clear into glibc on SIGSEGV handling unwind possibly. It ends up being a malloc(x) issue when it shouldn't AFAIK

SOLUTION:There were no problems with glibc, libopcodes, objdump, gcc, or kdbg. The issues arose from a dual context issue that could not be resolved and so the faults are reporting properly. The way in which the code is displayed when merged with source is very confusing, as the compiler does not generate code in the order that it is written in "C", but that is an optimization effect. Most of the problem stemmed from my confusion when I mixed "C" source and asm. The fact that it seemed to split an instruction to a zero which is not going to be pretty on Intel is what made me assume there was a flaw. I wish they had chosen -zero- as nop instead of 90h = 0x90. What were they thinking?

Overall the people who handle the core of Linux must be some very talented people as the code there is as close to gospel as one could ask for in such a complex environment. considering that the code that has made Microsoft trillions of dollars is virtually crap in comparison is always going to make me wonder how that happened the way it did. Linus has done the world a great service. Somebody should put him up for a Nobel prize of some kind.

Debugaroos

The picture is just to keep people entertained while I talk about debugging for the secret guild of the infinite cats and the long long %p sight that reads machine code. The image is something from blender that I was testing with my model render extension.

So I learned a few new things and I will give a link to the free source code that can be integrated into a package so you can get this info when developing. The link at Tux Linux User Group has some code and explanation of stack frames and signal interception code.

What I learned while including some code from another source is that it can be more useful when applied with some extras.

This is used on the dissassembled source to find a reference in a specific address range.

cat antsd.dsm | grep ' 403a'

This is used to dissassemble source in Intel format.

objdump -S prog -M intel >antsd.dsm

This is used to dissassemble source in ATT format.

objdump -S prog >antsd.dsm

This is just too cool. It gives you the file and line of the source.

addr2line 404840 -f -e antfarmgl

If you include this in your source code:

system('addr2line $codeaddress -f -e antfarmgl');

Then it will display to STDOUT during the SIGSEGV ( or whatever SIG ) handler

ADDED: For those of who NEED to know: Here is a link to explain what it does at KERNEL.ORG and here is some code for extending SIGSEGV handler, with quick fix code lines to lookup.

sz = backtrace(bt, 30); strings = backtrace_symbols(bt, sz); sprintf(syscom,"addr2line %x -f -e antfarmgl",bt[0]); system(syscom);

So what this does ( in technical terms ) is create a command to find where the f'up is, with the doo doo that is on the stack.

ADDED MORE:

for (i=0; i < sz; i++) { if ( bt[i] < (void *)0x40a000 && bt[i] > (void *)0x400000) { sprintf(syscom,"addr2line %p -f -e antfarmgl",bt[i]); system(syscom); } };
This is probably a little better WORSE. I wouldn't recommend this method to anybody (except the truly and deeply masochistic). It can lead to some recursion and double faults and glibc issues that could make things more difficult to diagnose. It is better to trap stderr to a file and extract the information there, if you want it automated. Your mileage may vary. I was using "kate" editor, with its own terminal shell ( which it does some odd thing to ), doing "pipe to console" from a script, opening 2 simultaneous glx contexts, using ATI fglrx, openGL, and then running auto debug SIGSEGV with a second shell from within a crashed program. I think I just confused myself quite enough for today.

Contributors

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen