Mahol Dot Org

Icon

Weblog For All Your Need

Fork Implementation In Windows Operating System Vfork Implement in Win32

With little understanding of fork basics here are few more findings on how to vfork implementation in windows operating system and
fork implementation on win32
AT&T Labs Research - Software Tools pick out UWIN: Unix on Windows 95 and NT Machines
Major difference in Linux/Unix functionality and WIN32 applications
Process control and management:
Fork implementation
processes can be created using the fork(2) function, in win32 includes a spawn family of functions that combines the functionality of fork/exec for efficiency.
File descriptor
Open files, pipes, sockets, fifos, and character and block special devices files have file descriptors associated with them. In windows it is called handle.
signals
Most of the unix/linux signals are absent in windows, like SIGALRM
SIGCHLD
SIGHUP
SIGINT
SIGKILL
SIGPIPE
SIGQUIT
SIGUSR1
SIGUSR2
these can be implemented using replacement methods like SIGALRM Time-out alarm can be implemented using SetTimer – WM_TIMER – CreateWaitableTimer
SIGCHLD Change in status of child can be implemented using WaitForSingleObject
Terminal interface for consoles, sockets, and serial lines

sockets based on WINSOCK:

File control locking:

Memory mapping and shared memory
mmap()

System V IPC
semaphore; Shmget can be implemented using CreateFileMaping or
OpenFileMapping
shmdt can be implemented using UnmapViewOfFile
shmat can be implemented using MapViewOfFile
Pipe to _pipe
Close to _close

Runtime linking of dynamically linked libraries : like The dlopen(), dlsym() interface
Error mapping from Windows to UNIX

Symbolic links
Symbolic links to files and directories can be created and can be implemented as Windows shortcuts.

Few Good References for Unix2Win porting

  1. Porting Socket Applications to Winsock
  2. Process and Thread Functions
  3. Winsock Programmer’s FAQ Articles: BSD Sockets Compatibility
  4. LibGW32C for GNU C library for Windows
  5. Unix to Windows Porting Dictionary for HPC
  6. UNIX Application Migration Guide
number of view: 27

Possibly Related Posts:


Cross Compiling Python 2.6.2 For ARM Cross Compiling Python for Embedded Linux

Tried to Cross Compile Python 2.6.2 For my ARM board, got success to successfully port python on ARM board, On ARM board Embedded Linux is already ported and running fine.

http://www.python.org/images/python-logo.gif ==>>  http://www.arm.com/images/site/arm_logo.gif

Here are simple steps to Cross compile python for ARM target board.

1) setup ARM tool chain with X11
2) export PKG_CONFIG_PATH

install dependencies
====================

Dependencies taken from DEBIAN
——————————
1) libdb
copy

2) libsqlite3
copy and change prefix in sqlite3.pc

3) ncursesw
copy

Dependencies installed from source
———————————–
1) bzip2
edit Makefile

CC=arm-linux-gcc
AR=arm-linux-ar
RANLIB=arm-linux-ranlib
PREFIX=your_toolchain_prefix_path

make
make install

2) gdbm
./configure –host=arm-linux –target=arm-linux –prefix=/xxx/yyy –enable-shared
make
make install
3) tcl-8.4.19
cd to unix folder

export ac_cv_func_strtod=yes
export tcl_cv_strtod_buggy=1

CC=arm-linux-gcc ./configure –host=arm-linux –prefix=/xxx/yyy

make
make install DESTDIR=/xxx/yyy

Note: dont install in prefix otherwise tk is not compiling.

4) tk-8.4.19

./configure –host=arm-linux CC=arm-linux-gcc
–prefix=/xxx/yyy –with-tcl=<path to unix folder in source of tcl>

make

make install

Note: you may have to move X11R6 from toolchain to /usr because its looking  in /usr for the X11 libs. if you do so remember to take backup of your /usr/X11R6 and then restore when you are done cross compiling python. Later find out why Makefiles are looking for X11R6 in /usr and change the path in those Makefiles..

5) readline-6.1
./configure
make
make install

6) openssl-0.9.8
There is no need to type configure, a Makefile is already existing. We just need to edit it and change it with way:

INSTALLTOP=/opt/external_packages/openssl/0.9.8g/compiled/xxx-yyy-linux-gnu
OPENSSLDIR=/opt/external_packages/openssl/0.9.8g/compiled/xxx-yyy-linux-gnu

CC= xxx-yyy-linux-gnu-gcc
AR=xxx-yyy-linux-gnu-ar $(ARFLAGS) r
RANLIB= xxx-yyy-linux-gnu-ranlib
To compile and install the OpenSSL project, type successively make and make install. You should find the directories and files listed above under /opt/external_packages/openssl/0.9.8g/compiled/xxx-yyy-linux-gnu/.

change pkg-config files

Patching Python-2.6.2 before crosscompile
—————————————–
1) ./configure
2) make python Parser/pgen
3) mv python hostpython
4) mv Parser/pgen Parser/hostpgen
5) make distclean

6) apply the patch Python-2.6.2-xcompile.patch
patch -p1 < Python-2.6.2-xcompile.patch

7) In Modules/Setup.config and setup.py according to
Setup.config and setup.py (TODO: make patches for setup.py and Setup.config).
8) edit Modules/getaddrinfo.c and change “u_” to “unsigned ”

Compiling Python-2.6.2
———————-
CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar RANLIB=arm-linux-ranlib ./configure –host=arm-linux –build=i686-pc-linux-gnu –prefix=/xxx/yyy
make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED=”arm-linux-gcc -shared” CROSS_COMPILE=arm-linux- CROSS_COMPILE_TARGET=yes
make  install HOSTPYTHON=./hostpython BLDSHARED=”arm-linux-gcc -shared” CROSS_COMPILE=arm-linux- CROSS_COMPILE_TARGET=yes prefix=~/Python-3.1.2

Dependencies – Setup.config and setup.py are configuration files are required to be modify for ARM board.

Downloads required for Cross Compiling Python for Embedded Linux

  1. Setup.config
  2. setup.py

Note -Rename python_setup_file to setup.py
Links -  Download Python

python corss compile patch used.

number of view: 53

Possibly Related Posts:


Ifort -extend-source Option Errors & Fortran Fixed Formatting Use nofree

Problem Definition
Working on FORTRAN source code migrations from Solaris operating system to windows XP.  Fortran being most portable code so most of the time we do not see any problems while porting fortran code, but there is always problem with columns length exceeds to default value and while compilations we forgot to take care of option extend-source.

Intel® Fortran compiler(ifort) – Option -extend-source

       -extend-source [size]
	      Specifies the column number to use to end the  statement	field
	      in  fixed-form source files. [size] can be 72, 80, or 132.  The
	      default behavior is -noextend-source, which implies column  72.
	      If  you  do  not	specify	 size,	it  is the same as specifying
	      -extend-source 132.

source ifort help or man ifort

Solution
The Makefile has a compiler flag called /extend_source:132, which basically extends the number of columns the Fortran compiler looks at. The default value is 72. /extend_source extends the number of columns that the compiler looks at to 132.

Fortran generally uses something called as Fixed Formatting - which takes 72 valid columns, ignores the rest and also considers tabs and spaces as comments inside a statement field.
/nofree tells the compiler that fixed formatting needs to be used. Most of the time code follows fixed formatting.

TO remove all compiler errors which pertain to syntax errors at Format statement just add some variable in your makefile, like
COLEXTEND=/extend_source:132

And when facing problem while compiling any fortran module in Windows just compile with COLEXTEND= /nofree.

example of make command, assuming windows makefile name as win.make

on command prompt type : nmake /f win.make COLEXTEND=/nofree

Good luck and do comment your experiences as well.

Related problem regarding

-extend-source option

number of view: 36

Possibly Related Posts:


How To Capture X Protocol Traffic Using Wireshark On Windows XP?

This is an experiment about use wireshark to capture X protocol traffic

Google and the wireshark manual/wiki give no hints (ie. How do you capture DISPLAY=:0.0 traffic ?). Setting wireshark to capture “local” (127.0.0.1) or “any” devices captured nothing. The remote X11
server
doesn’t support XRandR so it’s no help.

If you set DISPLAY=localhost:0 then the client will use TCP on the
loopback interface and wireshark can capture that. Of course your X
server can’t be running with “-nolisten tcp”, which is default in many
installations. thanks to Xcb thread discussion

Challenges
I want to capture localhost traffic on Windows Xp machine with Wireshark, and it fails.
Did google on it about Is there a way to get wireshark to capture packets sent from/to localhost on Windows?
Got this info from WIKI Loopback capture setup
Which says I need to install Loopback adapter and steps here for Microsoft: How to install the Microsoft Loopback adapter in Windows XP

This method did not help much expect able to capture only ARP packets,

Capturing local traffic on Windows XP Route method
> route add 155.132.130.129 mask 255.255.255.255 155.132.130.1 metric 1
where 155.132.130.129 is your local IP, and 155.132.130.1 that of your default gateway. You must have “Advanced TCP/IP Settings > Automatic metric” disabled! What it does is basically force each packet intended for localhost to go out to the default gateway first, from which it will come back again. Of course this means you see each packet twice.

===Not directly, but if you are on a network with a gateway, you can use the
command-line ROUTE command to redirect the packets through the gateway, which will bounce the packets back at your machine so Ethereal/Wireshark can capture them.  You can use comview tool. It can fullfil your wish. Wireshark does not use IM driver but it uses protocol driver.

Still digging on How To Capture X Protocol Traffic Using Wireshark On Windows XP?

number of view: 13

Possibly Related Posts:


Parse error: wp-content/themes/grid_focus/functions.php on line 6

Parse error: wp-content/themes/grid_focus/functions.php on line 6:

Wooo , this error I got, when i tried to add play with functions.php file,
I am using gridfocus-wordpress template,
Reason Why I was playing with this function is, I did not see any adds when the visitor comes on the pages with under pages TAGS
Eg, when visitor comes on this page,

from google.co.in on “Posts tagged “tancet2010-rank-list” – Mahol Dot Org

I am unable to show the Adds, but it is not problem with visitor comes from google.co.in on “www.unipune.ac.in | Pune Board | MKCL Results Pune

I could not able to locate the place, so thought of playing with functions.php file
I have just added the new line in this function and boom..
Parse error: wp-content/themes/grid_focus/functions.php on line 6
Nothing is coming up, unable to save the templates as well..
Solution:
Login to FTP, download the grid focus template. , and upload the file functions.php in /wp-content/themes/grid_focus.

This saved me, since I did not have taken backup of my blog and just doing changes.

Thanks god I am back. Enjoy

number of view: 10

Possibly Related Posts:


West Bengal JEXPO 2010 Merit List Results WB results online

West Bengal JEXPO 2010 Merit List: Jexpo results online website url working link to check results, of west bengal state jexpo online results link

then you can also go to visit the link which given below. WB Jexpo online merit list pdf document online download of select list of JEXPO2010

OK how to download JEXPO Merit LIst? Where can view JEXPO results, Merit List?

Online Results site : www.webscte.org

ABOUT JEXPO: The Jexpo examination conducted by west bengal state education board  and the jexpo held 2-05-10

Mathematics  and Physics & Chemistry  : Joint Entrance Examination (JEXPO-2010) was conducted by the West Bengal State Council of Technical Education
The Council published a merit list on the basis of the results of the JEXPO-2010
restls and merit list selected list for JEXPO2010 ON THE  website www.webscte.org

number of view: 17

Possibly Related Posts:


Degree B.Com results 2010 JRN Rajasthan Vidyapeeth University

JRN Rajasthan Vidyapeeth University B.Com Online results : View results online for the year 2010. you can access results. the results declared by the university officials.
Janardan Rai Nagar Rajasthan Vidyapeeth University (JRNRV), Udaipur announced the results list, and results are hosted on many sites.

The results update: BCom  3rd year B.Com 2010 Results.

J.R.N. Rajasthan Vidyapeeth University (Udaipur) and also many results like undergraduate courses, BSc, BA results online and   B.Com Third Year Examination 2010 results

announced on 2nd June, 2010 at 11:30 am. Rajasthan Vidyapeeth B.Com.

3rd year 2010 Results now available in the following links given below

Results at Schools9.com
B.Com 3rd yr 2010 Resul
www.IndiaResults.com site link for  B.Com Final year Resuts2010

similar search words: online results, check out results for  JRN Rajasthan Vidyapeeth University, 2010 notices, JRNRV,  RajasthanVidyapeeth BCom III year 2010 Results, online results alert JRNRV BCom III year 2010

number of view: 7

Possibly Related Posts:


Bihar 12th Class results online Intermediate Board results

Bihar 12th Class results online Intermediate Board results

Check out the updated Bihar 12th class results online at the website Behar. online results access now.

how to access the Bihar state Inter the 12th class  Results 2010. the results announced online at the many sites. you can download.
the examination annual examination conducted by Bihar School Examination  Board (BSEB) board . results announced and where to view results Intermediate Results 2010 Bihar Intermediate Education Council (BIEC) to be announced  Intermediate (SCIENCE) Examination Results 2010. Bihar Intermediate

Bihar  education board 12th class results released today ie  4th June, 2010 at 2:00 PM. The Bihar School

Students can access results at the following links. urls: Examination Board (BSEB) Intermediate

official site for BSEB www.biharboard.bih.nic.in

Related words search: Indian inter results indian results .coml  bihar inter result 2010, bihar state board 12th class results, intermediate exam 2010,  bihar intermediate education council, bihar intermediate exam 2010 online result, bihar intermediate

number of view: 23

Possibly Related Posts:


ICET 2010 answer Key www.icet2010.net/

ICET 2010 answer Key, solutions for ICET10 final answer key by ICET Official download direct in pdf word document of icet.

Andhra Pradesh STate MBA, MCA entrance examination 2010 ICET 2010 Solutions we can download. online link to download icet 2010 answer key.

How to download the key. ? ICET 2010 Solutions key.

students can download online from www.icet2010.net online

just visit online website url: www.icet2010.net Go to

Goto Answer key: then click download.

You can download and check answer key of icet online

number of view: 15

Possibly Related Posts:


How To Capture X Protocol Traffic Using Wireshark On Windows XP

This is an experiment about use wireshark to capture X protocol traffic

Google and the wireshark manual/wiki give no hints (ie. How do you capture DISPLAY=:0.0 traffic ?). Setting wireshark to capture “local” (127.0.0.1) or “any” devices captured nothing. The remote X11
server
doesn’t support XRandR so it’s no help.

If you set DISPLAY=localhost:0 then the client will use TCP on the
loopback interface and wireshark can capture that. Of course your X
server can’t be running with “-nolisten tcp”, which is default in many
installations. thanks to Xcb thread discussion

Challenges
I want to capture localhost traffic on Windows Xp machine with Wireshark, and it fails.
Did google on it about Is there a way to get wireshark to capture packets sent from/to localhost on Windows?
Got this info from WIKI Loopback capture setup
Which says I need to install Loopback adapter and steps here for Microsoft: How to install the Microsoft Loopback adapter in Windows XP

This method did not help much expect able to capture only ARP packets,

Capturing local traffic on Windows XP Route method
> route add 155.132.130.129 mask 255.255.255.255 155.132.130.1 metric 1
where 155.132.130.129 is your local IP, and 155.132.130.1 that of your default gateway. You must have “Advanced TCP/IP Settings > Automatic metric” disabled! What it does is basically force each packet intended for localhost to go out to the default gateway first, from which it will come back again. Of course this means you see each packet twice.

===Not directly, but if you are on a network with a gateway, you can use the
command-line ROUTE command to redirect the packets through the gateway, which will bounce the packets back at your machine so Ethereal/Wireshark can capture them.  You can use comview tool. It can fullfil your wish. Wireshark does not use IM driver but it uses protocol driver.

Still digging on How To Capture X Protocol Traffic Using Wireshark On Windows XP?

number of view: 7

Possibly Related Posts: