Vous êtes sur la page 1sur 9

Assignment No.

: 05 Problem Statement: Create Dynamic Link Library in VC++ and test it using Scientific
Calculator in VB.

Objectives:
To study DLL. Advantages of DLL Creation and use of DLL.

Theory:
What is DLL Explain Need of DLL. Types of DLL (static & dynamic)

Algorithm/Steps:
1. VC++: Invoke New\Projects\Win32 Dynamic-Link Library. Enter the directory where you want the VC++ project and the project name (MyFuncsProject in the example). 2. VC++: Invoke New\Files\C++ Source File. Check the Add To Project box. Enter the file name (MyFuncs.cpp in the example). 3. VC++: Enter the function's source code. Use __declspec (note the two underscores) to export the function's symbol. Use 'extern "C"' to minimize name mangling by VC++.
// Define DllExport to declare exported symbols. #define DllExport __declspec( dllexport ) // Prototype the function. // Use 'extern "C"' to minimize name mangling. extern "C" DllExport long MyCFunc(long x); // Define the function. extern "C" DllExport long MyCFunc(long x) { return x * x;

} 4. VC++: Set project options using Project\Settings. On the C/C++ tab, select the Code Generation category. Then change Calling Convention to __stdcall. 5. VC++: Select Build\Set Active Configuration. Select the Release configuration. Repeat step 4 to make the options apply to the release configuration in addition to the debug configuration. Use Build\Set Active Configuration to reselect the debug configuration if desired. 6. VC++: Build the project (press F7 or use the Build menu). This creates the DLL file. 7. Write application in VB which includes DLL as given below:

Assignment No.: 07 Problem Statement: Program to implement paging simulation using


1. 2. Lease Recently Used (LRU) Optimal algorithm

Objectives:
1. memory management. 2. replacement policies. To understand efficient frame management using To study page replacement policies to understand

Theory:
1. 2. miss ratio. Explain all page replacement policies. Explain concept of frames, pages, page hit & page

Algorithm:
Start Repeat until no more choices b. c. Define menu & read choice if choice-1 then

i. Read No. of frames, no. of pages & cache size ii. Calculate cache miss & hit ratio using LRU. c. if choice-2 then i. Read No. of frames, no. of pages & cache size ii. Calculate cache miss & hit ratio using optimal policy.

Input: No. of frames and no. of pages. Output: Cache hit and cache miss ratio. Conclusion: Thus page replacement policies studied. Assignment No.: 09 Problem Statement: Write a program to implement Bankers Algorithm Objectives:

10.Problem Statement:
concept

Implement producer-consumer algorithm using multi-threading

Objectives:
1. To understand multithreading concept 2. To understand producer-consumer problem 3. To study thread handling in UNIX / Linux 4. To understand synchronization of processes.

Theory:
i. ii. iii. Explanation of Multithreading. Explain the functions in Unix for handling the threads and semaphore. Explain producer-consumer problem .

Working:
producer-consumer problem also known as the bounded-buffer problem is a classical example of a multi-process synchronization problem. The problem describes two processes, the producer and the consumer, who share a common, fixed-size buffer. The producer's job is to generate a piece of data, put it into the buffer and start again. At the same time the consumer is consuming the data i.e. removing it from the buffer one piece at a time. The problem is to make sure that the producer won't try to add data into the buffer if it's full and that the consumer won't try to remove data from an empty buffer. The solution for the producer is to either go to sleep or discard data if the buffer is full. The next time the consumer removes an item from the buffer, it notifies the producer who starts to fill the buffer again. In the same way, the consumer can go to sleep if it finds the buffer to be empty. The next time the producer puts data into the buffer, it wakes up the sleeping consumer. The solution can be reached by means of inter-process communication, typically using semaphores. An inadequate solution could result in a deadlock where both processes are waiting to be awakened. The problem can also be generalized to have multiple producers and consumers.

Algorithm:
Producer

Assignment No.: 11 Problem Statement: Study UNIX system calls like ps, fork, join, exec family, wait. for
process management.

Theory:
1. 2. 3. What is System call? Explain the working of system call. Explain User mode and kernel mode. Explain the functions with syntax : fork, vfork, exec family, ps, join, kill,

wait, waitpid, getpid ,getppid, setpid, Exit, nice.

Conclusion: Thus studied various system calls used in unix OS for process management.

Assignment No.: 1 Problem Statement: Study of kernel, types of kernel, UNIX/ Linux kernel re-compilation Objectives:
1. To understand kernel concept 2. To understand types of kernel 3. To study kernel recompilation in UNIX / Linux

Theory:
1. Explanation of kernel, structure of kernel and various types of kernel like monolithic kernels, microkernels, hybrid kernels and exokernels. When do we recompile a kernel:-

1.To reduce the size of the kernel:


Suppose you are a Linux fanatic and you need an OS in your mobile. The typical OS you get has the all the miscellaneous components and has size in many MB s, which you cant afford in your mobile. If I were you, I would do a kernel recompilation, and remove unwanted modules. When the size of the kernel is reduced removing the unwanted items, less memory will be used which in turn will increase the resource available to applications.

2.To add or remove support for devices:


For each device, a device driver is needed for communicating with the operating system. For example, if a USB device is attached to a computer, we need to enable the corresponding device driver for it to work. In technical terms, the support for USB driver is to be enabled in the kernel.

3.To modify system parameters:


System parameters include high memory support, quota support etc. For managing physical memory above 4 GB, high memory support (64 GB) needs to be enabled. Tips to recompile the kernel: 1. 2. 3. 4. 5. 6. 7. Verify and update the packages required Obtain kernel source Obtain current hardware details Configure kernel Build kernel Configure the Boot loader Reboot the server

1. Verify and update the packages required

Vous aimerez peut-être aussi