[PATCH GOOD] RDSK patch works on Little-Endian - how about M68K?

Alex Butcher (linkern@cocoa.demon.co.uk)
Wed, 15 Sep 1999 21:12:40 +0100 (GMT)


Hi Ben -

> Had any luck with that patch?

Yup, I've tried it and it works here. The first time round I left out the
break; that would appear to be rather *ahem* critical. :)

> I hope it doesn't break support on Big Endian
> machines :)

Shouldn't do, because on B-E machines, be32_to_cpu is a NOP, just like
htonl was. On L-E machines, be32_to_cpu gets stuff the right way round. It
would still be good for a M68K person to test it out though. :)

> Anyhow, Cheers for the explanation of htonl and be32_to_cpu, makes perfect
> sense now.

[Hmmm... sounds interesting. htonl() converts from host- to network- byte
ordering (network byte-ordering is defined as Big- as opposed to
Little-endian so that everyone agrees what way round an IP address goes in a
packet header, say), whereas be32_to_cpu() converts big-endian to
cpu-endianness. Interestingly, the i386 architecture is little-endian, so
htonl() converts little- to big-endian, whereas be32_to_cpu() would appear
to convert big- to little-endian on Intel, and leave it the way it is on
M68K (big-endian).

This would probably result in RDSK partitions working properly on M68K (and
other big-endian architectures) and failing on x86 (and other little-endian
architectures) because it gets some of the values the wrong way round on
x86.

We're probably a very small minority (mounting Amiga devices on
little-endian boxes) so that's probably why no-one else has discovered the
problem.]

> I'd really like to get into linux programing... I remember the old Rom Kernel
> Manuals for the amiga, is there any kind of similar thing for linux?

At the application layer, Beginning Linux Programming (Wrox) is pretty
good and so is Using C on the UNIX System (O'Reilly) though the latter is a
little dated. It does cover a bit more of the system-level stuff though.
I've also got Linux Kernel Internals, 2nd Ed (Addison-Wesley) and I've heard
that the device driver book by Alesandro Rubini (O'Reilly) is good also.
Both lag a bit behind released kernels though. Finally, I saw in Linux
Journal that Coriolis have a Linux IP stack book (ISBN 1-57610-470-2) coming
out, which I will no doubt buy. Oh, and O'Reilly have a good POSIX book, but
if you wget around <http://www.UNIX-systems.org/online.html> you'll find
similar material.

> The C
> stuff is the easy stuff to pick up again, it's just the OS calls/standard
> macros/etc that will flummox me. I am usually very good at learning by
> example from other peoples code, but it strikes me that picking
> up linux programming may be just a tad beyond learning by example :)

It's pretty much the only way to go under Linux as the code tends to lead
published books by a good few months. Usually a major stable version. :)

> Ben

Best Regards,
Alex.

-- 
Alex Butcher   Using Linux since '95 - because windows are too easy to break.
Berkshire, UK  URLBLAST:slashdot.org:www.freshmeat.net:www.dejanews.com:
PGP:0x33489FD3 lwn.net:www.tomshardware.com:www.stardiv.de:www.gimp.org:

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/