In article <3F336F45.400A411A@ntlworld.com>, "Dr. David Kirkby" wrote: : Tony 'Nicoya' Mantler wrote: [...] : > x86 is little-endian : : Sorry it was late and I did not even think about what way around it : was. Yes, I accept that the bog-standard PC, which is what I was : meaning, is little-endian. : : In my life I've even come across a machine which I guess you would : call mid-endian or something like that. It was a 24-bit machine, with : either most (or might have been least) significant byte in the : middle!! That was on a Bruker NMR (or MRI as it's now called) clinical : system. I seem to recall there's one machine that's byte swapped on 16-bit boundaries, but I can't remember which one it is. : > Thanks primarily to Debian, endian errors are getting very rare, and : > pointer-size errors are slowly on their way out too. : : I don't know what Debian's contribution is, but it can't get around : the fact that if people write binary data, it will be unreadable on : another system, unless they make provision by having a switch to read : data in the other format, or they did what I once did, which was to : write a program such that the binary data was written in one format, : irrespective of the platform. Well, debian's contribution is to fix exactly that. Since they support so many different platforms, many packages have to get marked with bugs for incorrect endian support, or incorrect 64-bit support. Depending on the severity of the error, it *has* to be fixed by the next debian release, or the package faces exclusion. These fixes usually get pushed back upstream to the original programmers who are usually more than happy to see them. MacOS X is also helping things, being it's rather popular and runs on big-endian and now 64-bit hardware. [...] : > Possible but difficult. Every single platform uses a different API to send : > commands to and from drives. cdrecord gets around this by (no surprise) writing : > different drive interface code for every single platform. : : In which case, if you develop a program that needs low-level SCSI, why : not start from J�rg Schilling's code, where the API is I assume : consistent for cd-record, and the interface code is platform specific? : J�rg Schilling might like to comment on that. Well, two factors: 1) cdrecord records CDs. It's SCSI library isn't (last I checked) packaged in a seperate conviniently reusable form. 2) The programmer who wrote the SMART tools woke up one morning and said "I want to get SMART data on my linux box", not "I want to get SMART data on any unix box". From a simplicity standpoint, it's much easier to write a program for one system, then worry about portability, than it is to fuss about portability from the start, especially when it comes to APIs as varied as SCSI. : I accept low-level code is more difficult, but if people had access to : different systems cheaply, they might think about these issues more. Well, people need to have access, *and* want to use the machines. Sometimes I think that Linux/SPARC is more popular than Solaris/SPARC. : But there are many bits of code around where the too much is assumed : about the platform, that does not need to be. It might assume 'memset' : exists, which is not always the case. It might assume 'long long' : exists, which is not always the case. I can't help feeling that making : things like the OS and development tools readily available for : non-commercial use, will encourage more people to look to use other : hardware, and perhaps realise gcc is not the only compiler in the : world, and some of gcc's options are not accepted by someone else's : compiler. Porting an application that hasn't been ported much is always a bit of a headache. The biggest trick is learning the zen of autoconf. : > One of these days I might port smartmontools or some other package to IRIX, : > but I don't have a Sun so you're out of luck there. : : Well I have an SGI too, but are less concerned about that, as it only : runs a few hours/week and don't bother me too much. Yesterday and : Wednesday I had a lot of temperature problems on my older SPARC 20's : which have fast disks and fast CPUs in them. Hence my 'brute force' : approach to over-temperature protection : http://www.medphys.ucl.ac.uk/~davek/sun/cool.html : came into effect. Heh, ouch! I have to say I've never had any temperature problems with my SGI systems, even when the ambient temperature crawls over 30c. Cheers - Tony 'Nicoya' Mantler :) -- Tony 'Nicoya' Mantler -- Master of Code-fu -- nicoya@apia.dhs.org -- http://www.apia.dhs.org/ -- http://nicoya.feline.pp.se/ --