Archive for May, 2014

Our VME system is somewhat old, running Scientific Linux 4.7. Unfortunately, I was never able to get a newer version of the operating system working with these computers.

I needed to compile a program on this system. And the first attempt gave me tons of errors:

[root@wahcrate koto]# gcc adclossless.c -o adclossless -lvme
In file included from /usr/include/stdio.h:28,
                 from adclossless.c:1:
/usr/include/features.h:1: error: stray '\31' in program
/usr/include/features.h:1: error: stray '\139' in program
/usr/include/features.h:1: error: stray '\8' in program
/usr/include/features.h:1: error: stray '\2' in program
/usr/include/features.h:1: error: stray '\3' in program

Since I can’t really update this program, my hack to get this working was to copy any header files that were causing errors from a different computer. I copied the following files from a system running Red Hat Enterprise Linux, version 5.

/usr/include/features.h
/usr/include/gconv.h
/usr/include/alloca.h
/usr/include/errno.h
/usr/include/fcntl.h
/usr/include/getopt.h

In case this caused any problems, I renamed the old files first to .OLD. Lastly, the compilation complained about the file /usr/include/endian.h not being present. So I copied that file too.

After that the compilation worked.

[root@wahcrate koto]# gcc adclossless.c -o adclossless -lvme
/tmp/cc5q5khk.o(.text+0x270): In function `main':
: warning: the `gets' function is dangerous and should not be used.

I was also able to start the program.

[root@wahcrate koto]# ./adclossless 

 *************************************************** 
 *****     Beam Test Program for FADC Board     **** 
 *************************************************** 

(Slot:4 type:"none")>>help


    Commands:   read 
    Commands:   write    < value> 
    Commands:   read_vme  slot_number address 
    Commands:   write_vme slot_number address value 

    Commands:   run lb  <2.5, 3.125> 
    Commands:   run dc  
    Commands:   run db  
    Commands:   run ec  
    Commands:   run rnt  

    Commands:   reset_reg     
    Commands:   set slot_number   <1-21>
    Commands:   show
    Commands:   Exit,exit,q 


(Slot:4 type:"none")>>q

Unfortunately, at this point, I have no idea if it will work, since I don’t know how to use it. I will wait and see if it works for the student.

Commands to use to partition a new 3TB disk with parted.

[ ~]# parted /dev/sdg
GNU Parted 2.1
Using /dev/sdg
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Error: /dev/sdg: unrecognised disk label                                  
(parted) mklabel gpt                                                  
(parted) mkpart primary ext3 1 -1                                         
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? C                                                          
(parted) print                                                            
Model: ASMT 2105 (scsi)
Disk /dev/sdg: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart                                                           
Partition name?  []?                                                      
File system type?  [ext2]? ext3                                           
Start? 0%                                                                 
End? 100%

Using percentages worked better than trying to specify the start/stop sectors. Not sure why.

[ ~]# mkfs.ext3 /dev/sdg1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
183148544 inodes, 732566272 blocks
36628313 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
22357 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544

[ ~]# tune2fs -c0 -i0 /dev/sdg1