Simple Question Simple Answer
Let me begin by saying that I'm not really new to Linux but have only been doing Linux development for about a year now. I'm looking for a list of differences one must consider when trying to write drivers that are portable.
Correct me if I'm wrong, but the 2.2 code stream for Linux is ia32 while the 2.4 code stream is going to support ia64. Is there a list of gottchas somewhere that ISVs should watch out for? Please forgive me if this is something that has been asked a 1000 times, but hey.. I'm new.
-bmb-
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Brian Boerner
Brian> Correct me if I'm wrong, but the 2.2 code stream for Linux is Brian> ia32 while the 2.4 code stream is going to support ia64. Is Brian> there a list of gottchas somewhere that ISVs should watch out Brian> for? Please forgive me if this is something that has been Brian> asked a 1000 times, but hey.. I'm new.
It's not much, but there are some tips on porting to IA-64 Linux at:
http://www.devresource.hp.com/devresource/Topics/IA64Linux/IA64Linux.html
Click on the "technical tips -> IA-64 Linux porting" link to get to the right section.
--david
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Brian" = Brian Boerner <[email protected]> writes:
Brian> Let me begin by saying that I'm not really new to Linux but Brian> have only been doing Linux development for about a year Brian> now. I'm looking for a list of differences one must consider Brian> when trying to write drivers that are portable.
Brian> Correct me if I'm wrong, but the 2.2 code stream for Linux is Brian> ia32 while the 2.4 code stream is going to support ia64. Is Brian> there a list of gottchas somewhere that ISVs should watch out Brian> for? Please forgive me if this is something that has been asked Brian> a 1000 times, but hey.. I'm new.
That kinda depends on what you are trying to achieve. Are you trying to write drivers that run under both 2.2 and 2.4 (covering all applicaple architectures of course: little endian/big endian - 32 vs 64 bit) or just code that will run in 2.4?
There are some API changes which you have to deal with, but a lot of that can be handled by putting in backwards compatibility macros for 2.2 in your code. I use that trick in the AceNIC Gigabit Ethernet driver for instance (drivers/net/acenic.[ch]).
Jes
Allow me to pass on some words of wisdom I received from Alan Cox a while back. Particularly for IA-64, the comment to use the new PCI DMA architecture (linux/Documentatation/DMA-mapping.txt) has become especially important, as >4GB systems will be fairly common, and many drivers I've seen (as of September) were limiting system memory to 4GB because they hadn't migrated to this yet.
Thanks,
Matt
Alan Cox porting notes 6/12/2000
The 2.2 to 2.4 porting should be easy. The big points are:
Remember to use pci_enable_device
dev->base_address[foo]. is now dev->resource[foo].start and does not need masking for the flag bits
cli()/sti() type locking is now right out. In 2.2 its bad in 2.4 its very very bad 8)
Use the new scsi error handling - it really is a big win handling degrading setups.
The scsi proc has changed
If its a PCI irq allocate using SA_SHIRQ but you must now pass something other than NULL for the dev_id
If you want it to work on stuff like ia64 it needs to be both 64bit clean and touch mmio space only using readb/readw/readl etc not by direct pointer references.
If you want it to work with >4Gb of RAM you really want to use the new pci_alloc_consistent API - but I would worry about that once it works not before.
Alan