+ All Categories
Home > Documents > Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux...

Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux...

Date post: 23-Mar-2018
Category:
Upload: buikhanh
View: 221 times
Download: 0 times
Share this document with a friend
15
Rational Ada Developer Geoff Smith 12/11/2003 © 2003 IBM Corporation Adventures in Porting Rational Apex to Linux Presentation to ACM SIGAda 2003
Transcript
Page 1: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

Geoff Smith 12/11/2003 © 2003 IBM Corporation

Adventures in Porting Rational Apexto Linux

Presentation to ACM SIGAda 2003

Page 2: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation2 ACM SIGAda 2003 12/11/2003

Rational Apex product line

Apex Ada and Duo (Ada + C/C++)Apex EmbeddedTestMate AXI, etc.

has been repackaged …

IBM Rational Ada Developer

Page 3: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation3 ACM SIGAda 2003 12/11/2003

IBM Rational Ada Developer

Internally, product name remains “Apex”

Apex 4.2.2

Supported distributions

Red Hat 8.0 SuSE SLES 8

Red Hat 9.0 Red Hat Enterprise 3

SuSE 8.2 SuSE 9.0 (soon)

Page 4: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation4 ACM SIGAda 2003 12/11/2003

Why Linux?

Open source/open standards ideal

Increasing perception as a real OS

Rapid growth

Cost of ownership

Specifically, for Apex

Numerous customer inquiries

Several specific requests

IBM backing for Linux

Page 5: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation5 ACM SIGAda 2003 12/11/2003

The real reason (speaking as an engineer)

Linux is cool

Page 6: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation6 ACM SIGAda 2003 12/11/2003

Development Game Plan

Leverage existing components

X86 compiler (Apex Embedded)

Pentium II/III optimizations (Apex for Windows)

POSIX-based runtimes (UNIX platforms)

Elf OMF generation (Sparc)

Threaded cross debugger (Apex for LynxOS)

Experience with recent embedded ports

Page 7: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation7 ACM SIGAda 2003 12/11/2003

Development Goals

X86 – specifically, Pentium

Red Hat 7.3 and 8.0

Threaded runtime

Page 8: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation8 ACM SIGAda 2003 12/11/2003

Challenges

Page 9: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation9 ACM SIGAda 2003 12/11/2003

Dynamic vs. Static Libraries

Static linking is easier on UNIXes – harder on Linux

Threading is broken in static system libraries

Cannot mix-and-match system libraries

Big gap between Red Hat 7.3 and 8.0

New POSIX in Red Hat 9.0 is broken(Apex works around this)

Page 10: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation10 ACM SIGAda 2003 12/11/2003

Ada Priorities

Ada task = Linux thread

Linux: 3 scheduling policies– Round-Robin (RR), FIFO, “other”– RR and FIFO have priorities– “other” only 1 priority value – I.e., no priorities

Punch line: RR and FIFO require privileges

Usability dilemma

Page 11: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation11 ACM SIGAda 2003 12/11/2003

Signals

Under Linux, every thread is a process

Signal handling

Note a change is in the works – Native POSIX Thread Library (inc. in RH 9.0)

Page 12: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation12 ACM SIGAda 2003 12/11/2003

Stack Limit Check

Stack Limit checking required for Ada

Most CPUs: dedicate a register

Not feasible on x86

Runtime call– Rational Exec – not too burdensome– Linux – potential OS call, too burdensome

Page 13: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation13 ACM SIGAda 2003 12/11/2003

NFS

Solaris client, Linux host – slow!

Investigation– Linux server: NFS over TCP or UDP– Linux client: UDP– Common automount map => all clients use same– Result: Sol->Linux slow, or Linux->Linux broken

Fix: Patch to nfsmount.c

Page 14: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation14 ACM SIGAda 2003 12/11/2003

Conclusions

Page 15: Adventures in Porting Rational Apex to · PDF fileAdventures in Porting Rational Apex to Linux ... X86 compiler ... 7 ACM SIGAda 2003 12/11/2003 © 2003 IBM Corporation Development

Rational Ada Developer

© 2003 IBM Corporation15 ACM SIGAda 2003 12/11/2003

Conclusions

Linux:Definitely usable, but still a bit of a work-in-progress

Don’t bother with static libraries

Fundamental limitation wrt task priorities


Recommended