Re: Unix / Linux Program Port to OS/2 with GCC and LIBC: HowTo Support / Use of Unix Function "Symbolic Link" in OS/2 Environment
- From: Dave Yeo <dave.r.yeo@xxxxxxxxx>
- Date: Mon, 16 Jul 2007 23:28:38 GMT
Rainer Stroebel wrote:
Unix / Linux Program Port to OS/2 with GCC and LIBC:
HowTo Support / Use of Unix Function "Symbolic Link" in OS/2 Environment
Introduction by Example of the MPLAYER port
2007-07-16 22.00 first draft
1. Introduction and Credits
The discussion of the MPlayer port comes up with the above subject.
Thanks to Dave Yeo for the hint to the subject
and the porting of the GNU Core Utils ( http://www.gnu.org/software/coreutils/)
OS/2 port on Hobbes: http://hobbes.nmsu.edu/cgi-bin/h-search?key=coreutils_5.93
2.1 The Linux symbolic link function ( extract ) is introduced
by the example of the MPlayer OS/2 port installation
2.2 Here are two of the directories / files used by MPlayer
~/.mplayer --> %MPLAYER_HOME%
~/.mplayer/font/ --> %MPLAYER_HOME%\font
2.3 Symbolic Link to a file, a directory
In the Linux implementation "Symbolic Link" can be used
to define/reference the location / the font to be used for OSD
Here is a description of the function symbolic link in Linux
(part of it - excerpt )
http://linux.about.com/od/commands/l/blcmdl1_ln.htm
ln [OPTION]... TARGET [LINK_NAME]
Here with mplayer it is used
ln -s TARGET LINK_NAME
LINK_NAME used here with the example:
for a file "subfont" located at ~/.mplayer/subfont.fft
for a directory "font" located at ~/.mplayer/font
2.4 The LIBC Library of the GCC Compiler Project at Netlabs
The Libc Library - Part of the GCC Compiler Project at Netlabs -
ports Linux functions to an OS/2 system.
The ports take advantage of the OS/2 EA file system function to
implement Linux file function not supported by the native OS/2 environment.
e.g. the file attributes, the symbolic link information of
the Linux file system are stored in the EA.
The ported Linux programs running on OS/2 uses the LIBC functions for the Linux function.
The information stored in the EA is totally initializes and maintained by the
LIBC functions.
If you want to excess and handle this information, you have to use LIBC functions.
2.5 The port of the Linux command ln and ls ( part of the GNU Core Utils package)
The GNU Core Utils has been ported with the GCC 3.5.5 and the LIBC 6.3 Library.
The ported ln function display the Linux file attributes and link formation stored
in the EAs
example:
file: ~/.mplayer/subfont.fft --> %MPLAYER_HOME%\subfont.fft
directory: ~/.mplayer/font --> %MPLAYER_HOME%\font
The special file subfont.fft is an link/reference to the a real file with the TrueType font.
2.5.1 LN execution
The assignment is done with the ln command
[S:\mplayer_home]ln -s L:\OS2\MDOS\WINOS2\SYSTEM\ARIAL.TTF subfont.ttf
Lets have a look at the results of the function:
2.5.2 dir
[S:\mplayer_home]dir subfont.ttf
Datenträger, Laufwerk S, hat den Namen VL_S_HPFS.
Datenträgernummer ist 298A:7814
Verzeichnis von S:\mplayer_home
16.07.07 18.23 36 175 subfont.ttf
1 Datei(en) 36 Byte belegt
206073856 Byte frei
36 bytes stored in the file and 175 bytes in the EA s of the file!
2.5.3 Type command executed with the special symbolic link file
[S:\mplayer_home]type subfont.ttf
L:\OS2\MDOS\WINOS2\SYSTEM\ARIAL.TTF <----------- contents of the file
2.5.4 OS/2 command: Type -ea show the contents of the EA s
[S:\mplayer_home]type -ea:subfont.ttf
UID[CRITICAL EA](EAT_BINARY)
00 00 00 00 ....
GID[CRITICAL EA](EAT_BINARY)
00 00 00 00 ....
MODE[CRITICAL EA](EAT_BINARY)
FF A1 00 00 ....
INO[CRITICAL EA](EAT_BINARY)
F5 82 BF 1C B2 B7 4A 6A ......Jj
RDEV[CRITICAL EA](EAT_BINARY)
00 00 00 00 ....
GEN[CRITICAL EA](EAT_BINARY)
00 00 00 00 ....
FLAGS[CRITICAL EA](EAT_BINARY)
00 00 00 00 ....
SYMLINK[CRITICAL EA](EAT_ASCII)="L:\OS2\MDOS\WINOS2\SYSTEM\ARIAL.TTF"
2.5.5 ls execution
[S:\mplayer_home]S:\download\os2\GNU-Core-Utils\V5-93\bin\ls.exe -l
total 129
-rw-r--r-- 1 0 0 173 2007-07-13 19:03 config
lrwxrwxrwx 1 0 0 36 2007-07-16 18:23 subfont.ttf -> L:\OS2\MDOS\WINOS2\SYSTEM\ARIAL.TTF
[S:\mplayer_home]
3.0 Conclusio
With the ln and ls function - part of ported GNU Core utils
we have access of the Linux file function at OS/2 command level
4.0 Caveat - usage of the current port GNU Core Utils V5.93 readme.os2
--> snip
Most programs seem to work with at least the exceptions of touch.exe and du.exe
unsure why as a previous build with an older version of GCC 3.3.5 did work.
Programs such as cp.exe, mv.exe have no EA support. I repeat moving files with
cp or mv etc will see EAs get stripped.
Of particular interest is symlink support for programs compiled with klibc such
as Mplayer and most of Paul Smedleys ports. Also large files support should be
enabled.
--> snip
Feedback??
Rainer
Was that a good upload? Hobbes shows a different size then I uploaded and being on slow dialup I haven't checked it yet
Dave
.
- Follow-Ups:
- References:
- Prev by Date: Re: MPlayer OS/2 port Howto install a font (TrueType) On Screen Dispaly OSD
- Next by Date: Re: Unix / Linux Program Port to OS/2 with GCC and LIBC: HowTo Support/ Use of Unix Function "Symbolic Link" in OS/2 Environment
- Previous by thread: Unix / Linux Program Port to OS/2 with GCC and LIBC: HowTo Support / Use of Unix Function "Symbolic Link" in OS/2 Environment
- Next by thread: Re: Unix / Linux Program Port to OS/2 with GCC and LIBC: HowTo Support/ Use of Unix Function "Symbolic Link" in OS/2 Environment
- Index(es):
Relevant Pages
|