VM system manages the mapping of physical to users processes & kernel i.e., VM system manages system's memory on behalf of kernel and processesResponsibilities of VM system:(1) manages virtual-to-physical mapping of memory(2) presents a simple memory programming model to applications so that application developers need not know how the underlying memory hardware is arranged <- memory is abstracted; user applications deal with virtual addresses and virtual address spaces(3) allows processes to see linear ranges of bytes in their address space...
Tuesday, 28 September 2004
Sunday, 26 September 2004
Linux: Installing Source RPM (SRPM) package
Posted on 15:35 by Unknown
RPM stands for RedHat Package Manager. RPM is a system for installing and managing software & most common software package manager used for Linux distributions. Because it allows you to distribute software already compiled, a user can install the software with a single command.There are two flavors of RPMs: binary & source code. Source code are designated by ending with -src.rpm rather than just .rpmInstalling source rpms (SRPM):Unlike ordinary packages, they can't be uninstalled using RPM. SRPM packages are not under the control of the...
Saturday, 25 September 2004
Linux: Installing Dynamic Fonts
Posted on 02:39 by Unknown
Make sure xfs (X Font Server) is installed1) Copy all true type/dynamic fonts to /usr/X11R6/lib/X11/fonts/truetype directory2) Restart X Font Server as root user /etc/init.d/xfs restart3) Restart web browserAlternate method:1) Copy all true type/dynamic fonts to $HOME/.fonts2) Restart X Font Server as root /etc/init.d/xfs restart3) Restart web browserLet the browser show the fonts being used in the web page i.e., do not override the default font settings by selecting "Always use my fonts" opt...
Wednesday, 22 September 2004
UNIX/C: Program that prints Itself
Posted on 16:44 by Unknown
Source:% cat printme.c#include <stdio.h> char *s="char *s=%c%s%c;%cmain(){printf(s,34,s,34,10,10);}%c"; main() { printf(s,34,s,34,10,10);} Compilation line:% CC -o printme printme.cOutput:% ./printmechar *s="char *s=%c%s%c;%cmain(){printf(s,34,s,34,10,10);}%c"; main(){printf(s,34,s,34,10,10...
Tuesday, 21 September 2004
SPARC: Position Independent Code (PIC)
Posted on 16:57 by Unknown
The code within a dynamic executable is usually tied to a fixed address in memory; but position-independent code can be loaded anywhere in the address space of a process. Because the code is not tied to a specific address, it will execute correctly without page modification at a different address in each process that uses it. This code creates programs that require the smallest amount of page modification at runtime.If a shared object is built from code that is not position-independent, the text segment will usually require a large number of relocations...
Monday, 20 September 2004
Solaris/S1S9: Scope of Symbols IV - hidden scope
Posted on 17:37 by Unknown
[Updated: 04/07/2006] Much accurate information is available in a better format at:Reducing Symbol Scope with Sun Studio C/C++__________________The answer is to hide all the symbols within the module and export only those that are needed to external modules (objects). It can be achieved with the "hidden" value to -xldscope flag ie., -xldscope=hiddenAn exert is from S1S9 documentation regarding hidden scope:The symbol has hidden linker scoping. Hidden linker scoping is more restrictive than symbolic and global linker scoping. All references within...
Solaris/S1S9: Scope of Symbols - Adv/Disadv of GLOB scope
Posted on 13:29 by Unknown
Advantages of global scope:1) Easy to use interposing libraries2) No worries about the application during run-time; if the run-time linker finds the right set of symbols, the application works just fine3) No need for special mechanisms like linker map files or special compiler flags to make the symbols global in scopeDisadvantages of global scope:1) Chance of namespace collisions with 3rd party libraries2) Run-time performance will be a little slow because of the i-cache miss% & #page faults3) Chance of accidental/malicious interposition...
Friday, 17 September 2004
Solaris/S1S9: Scope of Symbols :: III symbolic scope contd.,
Posted on 11:27 by Unknown
[Updated: 04/07/2006] Much accurate information is available in a better format at:Reducing Symbol Scope with Sun Studio C/C++__________________The alternative to link-editor's -Bsymbolic is the compiler driver's -xldscope=symbolic flag. Sun ONE Studio 8 (aka S1S8) introducted a new flag -xldscope={global|symbolic|hidden} for specifying the appropriate linker scoping within the source program"global" will be assumed as the value for -xldscope if none were specified. The interpretation for the value "global" from Sun's official documentation is...
Thursday, 16 September 2004
Solaris/S1S9: Scope of Symbols - III symbolic scope
Posted on 13:24 by Unknown
[Updated: 04/07/2006] Much accurate information is available in a better format at:Reducing Symbol Scope with Sun Studio C/C++__________________The default left-to-right dependency ordering can be overridden by using the link-editor (ld) flag: -Bsymbolic-Bsymbolic works in dynamic mode only i.e., while creating dynamic objects like shared objects. This flag informs the link-editor to bind all references to global symbols to their definitions, if available within the object.This is the flag to be used in our example to get the correct result, as...
Wednesday, 15 September 2004
Solaris/S1S9: Scope of Symbols: Default scope contd.,
Posted on 18:12 by Unknown
[Updated: 04/07/2006] Much accurate information is available in a better format at:Reducing Symbol Scope with Sun Studio C/C++__________________Lets add one more local method called "addtentomyage()" in hidden.hhidden.h---------bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%cat hidden.c#include#include "hidden.h"int age = 25;int addtentomyage(int age){ return ((int) age + 10);}char *lastname(char *firstname){ return ((char *)"mandalika");}char firstchar(char *strings){ return (*strings);}int agefunc(){ int finalage = 0; finalage...
Tuesday, 14 September 2004
Solaris/S1S9: Scope of Symbols - II :: Default scope
Posted on 16:29 by Unknown
[Updated: 04/07/2006] Much accurate information is available in a better format at:Reducing Symbol Scope with Sun Studio C/C++__________________Default behavior----------------bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%CC -c hidden.cscope of symbols inside object "hidden.o":bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%elfdump -C -s hidden.oSymbol Table: .symtab index value size type bind oth ver shndx name [3] 0x00000080 0x0000002c FUNC GLOB D 0 .text int agefunc() [4] 0x00000050...
Solaris/S1S9: Scope of Symbols - I :: Source files
Posted on 16:24 by Unknown
[Updated: 04/07/2006] Much accurate information is available in a better format at:Reducing Symbol Scope with Sun Studio C/C++__________________bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%which CC/sunbuild3/S1S9_0609/SUNWspro/bin/CCbpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%CC -VCC: Sun C++ 5.6 d-iteam 2004/06/09bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%ls -ltotal 8-rw-r--r-- 1 build engr 215 Sep 14 15:59 hidden.c-rw-r--r-- 1 build engr 63 Sep 14 15:58 hidden.h-rw-r--r-- 1 build engr...
Thursday, 9 September 2004
Solaris & UltraSPARC IV: Displaying processor information
Posted on 21:11 by Unknown
"psrinfo" displays information about processors and virtual processors (USIV supports virtual processors; Each physical processor may support multiple virtual processors & each virtual processor may support multiple virtual processors)govinda@/users/techno> psrinfo0 on-line since 09/03/2004 17:17:071 no-intr since 09/05/2004 14:11:562 no-intr since 09/05/2004 14:11:563 no-intr since 09/05/2004 14:11:56512 on-line since 09/03/2004 17:17:14513 no-intr since 09/05/2004 14:11:56514 no-intr since...
Tuesday, 7 September 2004
JDS: Installing Sun Java Desktop System 2.0
Posted on 23:54 by Unknown
This document will guide you through the process of installing JDS 2.0 on a PC from integrated CDROM images Requirements In order to complete the installation you will require the following: A laptop or desktop PC meeting these requirements: Recommended Minimum Processor Pentium III, compatibile PC 600Mhz Pentium II, compatible PC 266MHz Hard Disk 6GB 4GB RAM 256MB 128MB Display Resolution 1024 x 768...
Solaris: malloc Vs mtmalloc
Posted on 14:03 by Unknown
Performance of Single Vs Multi-threaded applicationMemory allocation performance in single and multithreaded environments is an important aspect of any application. Some allocators, such as malloc on Solaris Operating Environment work best with single-threaded applications, but degrades performance with a multi-threaded application. As memory is being allocated concurrently in multiple threads, all the threads must wait in a queue while malloc() handles one request at a time. With a few extra threads, this can slow down performance, causing a problem...
Monday, 6 September 2004
Solaris: Recovering from a Runtime Linker Failure
Posted on 01:54 by Unknown
ld.so.1 Failure: Cannot execute /usr/lib/ld.so.1 Imagine a situation where you are playing with the runtime linker (ld.so.1) and by accident you overwrite the default runtime linker with another linker that is incompatible or buggy. All of a sudden all dynamically linked applications stop working, including the user and system utility commands, and you see this error message: Cannot execute /usr/lib/ld.so.1, Killed Do not panic and do not close the terminal window in which you are working. A couple of simple steps will bring the system back...
Linux: Finding out the amount of free & used memory
Posted on 01:04 by Unknown
The command free can be used to display the total amount of free and used physical and swap memory in the system,as well as the shared memory and buffers used by the kerneltechno/work> which free/usr/bin/free/users/techno> free total used free shared buffers cachedMem: 384888 314220 70668 0 19740 57504-/+ buffers/cache: 236976 147912Swap: 524280 81232 443048Interpreting the output of free:All the numbers are reported in 1024-byte blocks. Here, we see...
Sunday, 5 September 2004
UNIX®: How to build a Shared Library (*.so file)
Posted on 04:41 by Unknown
It's very easy to build a Shared Library on Solaris (and *nix in general). However, the Solaris link-editor (/usr/ccs/bin/ld)has quite a few options. It can sometimes be very confusing to determine which options to use. Some of the general rules are outlined here:Let the compiler do the workFirst - do not invoke the link-editor (/usr/ccs/bin/ld) directly, instead run it via your compiler driver (cc/gcc/CC/g++). The compiler driver will include many magic files (crt*.o, values-xa.o, ...) which are important to the construction of your shared library....
Subscribe to:
Posts (Atom)