09-22-2007
execution small C++ program in UNIX
Hi my friends
I am beginner unix programmer I have written small c++ program in text editor and I have change it mode to 555 to make it executable file to use it in unix O.P.
#include<iostream.h>
main()
{
cout<<"Hello World";
}
but some syntax erroe came for <<
can any one help me how can I make executable file to use it unix o.p.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Write a shell script (to run on the Bourne shell) that runs an infinite loop to check every 5 seconds to report on who logs into and who logs out of a UNIX system. Without loss of practical significance of this little utility, we can ignore multiple logins from the same user during a time period of... (1 Reply)
Discussion started by: lydragon
1 Replies
2. Linux
how can I compile and execute multifile program in unix os.:o (0 Replies)
Discussion started by: alokmishra8
0 Replies
3. Programming
Hi,
I wanted to know if i can write a program using switches and signals, etc to trace execution of other unix program which calls c program internally.
If yes how? If not with signals and switches then are there any other methods apart from debugging with gdb/dbx. (3 Replies)
Discussion started by: jiten_hegde
3 Replies
4. UNIX for Dummies Questions & Answers
Hello Geniuses of the unix world. please help, stupid chemist. I have the following script that I need to create a file. Doesnt make sense unless i explain this way: I need to create a file called summary.in I would like all these lines to be inserted however in the command line I would like the... (1 Reply)
Discussion started by: gingburg
1 Replies
5. Programming
I have made use of 'valgrind' and -finstrument-functions compiler option for debugging / analyzing code. Both the options lets us know the line / file being executed to some extent.
Is there a generic way that lets program dump the file:line it is getting executed dumped to a log file during... (3 Replies)
Discussion started by: uunniixx
3 Replies
6. Shell Programming and Scripting
I am trying to understand a program in a book and this program suppose to call other programs which are in the same folder, the other programs are called 'lu' and 'add' but for some reason when it gets to the last line of each case to call these programs there is an error message saying
./rolo:... (2 Replies)
Discussion started by: bartsimpsong
2 Replies
7. Programming
//Find the root of the equation (x^2)-2 by bisection method.
#include<iostream>
using namespace std;
double a,x;
double f(double x)
{
return ((x*x)-2);
} //Suppose the function is (x*x)-2.
void calcx(double a1,double b1)
{
x =... (2 Replies)
Discussion started by: poonam.gaigole
2 Replies
8. Shell Programming and Scripting
I need UNIX scripts for polling, Uncompressing files and moving files between directory. Also trying to save file paths and any other variables in an independent file (.env) and use these at runtime by executing this file in the main script. (3 Replies)
Discussion started by: new2script
3 Replies
9. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
1. Create a series of commands for a grading program.
Create a grades file. Put a "tab" between the name and... (7 Replies)
Discussion started by: Jagst3r21
7 Replies
10. Shell Programming and Scripting
Here's the assignment. I'll bold the parts that are rough for me. Unfortunately, that's quite a bit lol. The syntax is, of course, where my issues lie, for the most part. I don't have a lot of programming experience at all :/. I'd post what I've already done, but I'm so lost I really don't know... (1 Reply)
Discussion started by: twk101
1 Replies
BOOT(8) System Manager's Manual BOOT(8)
NAME
boot - startup procedures
DESCRIPTION
A PDP11/45 and PDP11/70 UNIX system is started by a two-stage process. The first is a primary bootstrap which is able to read in rela-
tively small stand-alone programs; the second (called boot) is used to read in the system itself.
The primary bootstrap must reside in the otherwise unused block zero of the boot device. It can be read in and started by the standard ROM
programs, or if necessary by keying in a small startup routine. This program is capable of loading type 407 executable files (not shared,
not separate I&D). The user types on the system console the name of the program wished, in this case boot, followed by a carriage return;
the named program is retrieved from the file system that starts at block 0 of drive 0 of the boot device. No prompt is given, no diagnos-
tic results if the file cannot be found, and no provision is made for correcting typographical errors.
The second step, called boot, actually brings in the system. When read into location 0 and executed, boot sets up memory management, relo-
cates itself into high memory, and types a `:' on the console. Then it reads from the console a device specification (see below) followed
immediately by a pathname. Boot finds the corresponding file on the given device, loads that file into memory location zero, sets up mem-
ory management as required, and calls the program by executing a `trap' instruction. Normal line editing characters can be used.
Conventionally, the name of the secondary boot program is `/boot' and the name of the current version of the system is `/unix'. Then, the
recipe is:
1) Load block 0 of the boot device by fiddling with the console keys as appropriate for your hardware. If you have no appropriate ROM,
some programs suitable for manual use are given below.
2) Type boot.
3) When the prompt is given, type
hp(0,0)unix
or
rp(0,0)unix
depending on whether you are loading from an RP04/5/6 or an RP03 respectively. The first 0 indicates the physical unit number; the
second indicates the block number of the beginning of the logical file system to be searched. (See below).
When the system is running, it types a `#' prompt. After doing any file system checks and setting the date (date(8)) a multi-user system
is brought up by typing an EOT (control-d) in response to the `#' prompt.
Device specifications. A device specification has the following form:
device(unit,offset)
where device is the type of the device to be searched, unit is the unit number of the device, and offset is the block offset of the file
system on the device. Device is one of the following
rp RP03
hp RP04/5/6
rk RK05
For example, the specification
hp(1,7000)
indicates an RP03 disk, unit 1, and the file system found starting at block 7000 (cylinder 35).
ROM programs. The following programs to call the primary bootstrap may be installed in read-only memories or manually keyed into main mem-
ory. Each program is position-independent but should be placed well above location 0 so it will not be overwritten. Each reads a block
from the beginning of a device into core location zero. The octal words constituting the program are listed on the left.
RK (drive 0):
012700 mov $rkda,r0
177412
005040 clr -(r0) / rkda cleared by start
010040 mov r0,-(r0)
012740 mov $5,-(r0)
000005
105710 1: tstb (r0)
002376 bge 1b
005007 clr pc
RP (drive 0)
012700 mov $rpmr,r0
176726
005040 clr -(r0)
005040 clr -(r0)
005040 clr -(r0)
010040 mov r0,-(r0)
012740 mov $5,-(r0)
000005
105710 1: tstb (r0)
002376 bge 1b
005007 clr pc
FILES
/unix - system code
/usr/mdec/rpuboot, /usr/mdec/hpuboot - copies of primary bootstrap
/boot - second stage bootstrap
SEE ALSO
init(8)
BOOT(8)