OSA A2

A2: Displaying a list of devices connected to the system, mounting and unmounting a device by using commands.


->  Program:

while true

do

echo "1.Display all terminal devices:";

echo "2.Display memory map :";

echo "3.Display processor information :";

echo "4.Exit";

echo "Enter your choice : ";

read ch;

case $ch in

1)

echo "All terminal devices : ";

lspci

;; # to break first switch case

2)

echo "Memory map :";

free -m #to display the total,available & used RAM (memory)

;;

3)

echo "Processpr information : "; # u can use cat /proc/cpuinfo

cat /proc/cpuinfo

;;

4)

exit;

;;

esac # end of switch case

done

[student@localhost Assingments]$ gedit A-2.sh

[student@localhost Assingments]$ chmod 777 A-2.sh

[student@localhost Assingments]$ ./A-2.sh

1.Display all terminal devices:

2.Display memory map :

3.Display processor information :

4.Exit

Enter your choice :

1

All terminal devices :

00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)

00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)

00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)

00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)

00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)

00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)

00:0f.0 VGA compatible controller: VMware SVGA II Adapter

00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI

(rev 01)

00:11.0 PCI bridge: VMware PCI bridge (rev 02)

00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)

00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)

00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)

00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)

02:00.0 USB controller: VMware USB1.1 UHCI Controller

02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)

02:02.0 Multimedia audio controller: Ensoniq ES1371 / Creative Labs CT2518 [AudioPCI-97] (rev 02)

02:03.0 USB controller: VMware USB2 EHCI Controller

1.Display all terminal devices:

2.Display memory map :

3.Display processor information :

4.Exit

Enter your choice :

2

Memory map :

total       used       free     shared    buffers     cached

Mem:          6460       1049       5411          1         40        390

-/+ buffers/cache:        617       5843

Swap:         2063          0       2063

1.Display all terminal devices:

2.Display memory map :

3.Display processor information :

4.Exit

Enter your choice :

3

Processpr information :

processor : 0

vendor_id : GenuineIntel

cpu family : 6

model : 69

model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz

stepping : 1

microcode : 0x1c

cpu MHz : 2394.455

cache size : 4096 KB

physical id : 0

siblings : 2

core id : 0

cpu cores : 2

apicid : 0

initial apicid : 0

fpu : yes

fpu_exception : yes

cpuid level : 13

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx

fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable

nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt

tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm ida arat epb xsaveopt pln pts dtherm

fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid

bogomips : 4788.91

clflush size : 64

cache_alignment : 64

address sizes : 42 bits physical, 48 bits virtual

power management:

processor : 1

vendor_id : GenuineIntel

cpu family : 6

model : 69

model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz

stepping : 1

microcode : 0x1c

cpu MHz : 2394.455

cache size : 4096 KB

physical id : 0

siblings : 2

core id : 1

cpu cores : 2

apicid : 1

initial apicid : 1

fpu : yes

fpu_exception : yes

cpuid level : 13

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx

fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable

nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt

tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm ida arat epb xsaveopt pln pts dtherm

fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid

bogomips : 4788.91

clflush size : 64

cache_alignment : 64

address sizes : 42 bits physical, 48 bits virtual

power management:

processor : 2

vendor_id : GenuineIntel

cpu family : 6

model : 69

model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz

stepping : 1

microcode : 0x1c

cpu MHz : 2394.455

cache size : 4096 KB

physical id : 1

siblings : 2

core id : 0

cpu cores : 2

apicid : 2

initial apicid : 2

fpu : yes

fpu_exception : yes

cpuid level : 13

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx

fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable

nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt

tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm ida arat epb xsaveopt pln pts dtherm

fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid

bogomips : 4788.91

clflush size : 64

cache_alignment : 64

address sizes : 42 bits physical, 48 bits virtual

power management:

processor : 3

vendor_id : GenuineIntel

cpu family : 6

model : 69

model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz

stepping : 1

microcode : 0x1c

cpu MHz : 2394.455

cache size : 4096 KB

physical id : 1

siblings : 2

core id : 1

cpu cores : 2

apicid : 3

initial apicid : 3

fpu : yes

fpu_exception : yes

cpuid level : 13

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx

fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable

nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt

tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm ida arat epb xsaveopt pln pts dtherm

fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid

bogomips : 4788.91

clflush size : 64

cache_alignment : 64

address sizes : 42 bits physical, 48 bits virtual

power management:

1.Display all terminal devices:

2.Display memory map :

3.Display processor information :

4.Exit

Enter your choice :

4

[student@localhost Assingments]$

0 comments:

Post a Comment