0% found this document useful (0 votes)
110 views

CCP Operating System

This document outlines the design and implementation of a distributed resource management system (DRMS) aimed at optimizing resource utilization and ensuring compatibility between Linux and Windows systems. It covers process management, memory management, file systems, and scheduling, detailing the challenges of cross-platform integration and the proposed solutions. The methodology includes analyzing APIs, developing prototypes, and benchmarking scheduling algorithms, with annotated source code provided for key components.

Uploaded by

shazilfaisal365
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views

CCP Operating System

This document outlines the design and implementation of a distributed resource management system (DRMS) aimed at optimizing resource utilization and ensuring compatibility between Linux and Windows systems. It covers process management, memory management, file systems, and scheduling, detailing the challenges of cross-platform integration and the proposed solutions. The methodology includes analyzing APIs, developing prototypes, and benchmarking scheduling algorithms, with annotated source code provided for key components.

Uploaded by

shazilfaisal365
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

OPERATING SYSTEM

Complex Computing Problem (CCP)

NAME:
Shazil faisal

REG ID:
59805
DATE:
16-JAN-2025
FACULTY NAME
SIR MUHAMMAD DAUD ABBASI

Introduction:
The increasing reliance on hybrid IT infrastructures, which often incorporate
Linux-based servers and Windows client machines, demands efficient resource
management solutions that are both robust and compatible across platforms. This
document outlines the design and implementation of a distributed resource
management system (DRMS) that ensures optimal resource utilization, secure file
handling, and seamless process synchronization. The primary goal is to enable
effective collaboration between Linux and Windows systems while leveraging
their respective strengths.

 Highlight the challenges posed by cross-platform compatibility and the expected


benefits of the proposed solution.
 Provide an overview of the problem, its significance, and the objectives of the project.

Literature Review:
Process Management

1. Linux Process Management:


o Process creation: fork() and exec() system calls.
o Interprocess Communication (IPC): Mechanisms like pipes, message queues,
shared memory, and signals.
o Termination: Handled via exit() and monitored using wait().
2. Windows Process Management:
o Process creation: CreateProcess() API.
o IPC: Named pipes, mailslots, and memory-mapped files.
o Termination: Managed using TerminateProcess() and process
handles.

Memory Management

1. Linux:
oRelies on virtual memory, paging, and swapping.
oImplements memory sharing via shared memory (shmget, shmat).
2. Windows:
o Uses VirtualAlloc and VirtualFree APIs.
o Memory sharing facilitated via memory-mapped files.

File Systems

1. Linux ext4: Journaling file system offering robust metadata handling and efficient large
file storage.
2. Windows NTFS: Features ACL-based security, journaling, and efficient disk space
utilization.
Scheduling

1. Linux Completely Fair Scheduler (CFS): Ensures balanced CPU time distribution
among processes.
2. Windows Scheduler: Implements a priority-based preemptive scheduling algorithm.

Designed Model:
The proposed architecture integrates process, memory, and file management while ensuring
platform compatibility:

1. Process Management Module:


o Cross-platform process creation and synchronization using abstraction layers.
2. Memory Management Module:
o Shared memory framework leveraging system-specific features (e.g., shmget for
Linux, memory-mapped files for Windows).
3. File Transfer Module:
o Custom protocol for consistent file access and integrity checks during ext4-to-
NTFS transfers.
4. Task Scheduler:
o Unified scheduling layer to prioritize tasks based on CPU load and network
latency.

Methodology:
1. Analyze Linux and Windows APIs to identify commonalities and differences.
2. Implement prototypes for process creation, memory sharing, and file transfer.
3. Benchmark scheduling algorithms using simulated workloads.
4. Develop cross-platform wrappers to abstract underlying system complexities.
5. Process management simulation on both platforms.
6. Implementation of cross-platform IPC and shared memory.
7. Development of a file transfer mechanism with metadata preservation.
8. Simulation and evaluation of scheduling algorithms under high concurrency.

Source Codes:
Annotated source code is included for:

1. Cross-platform process management.


2. Shared memory abstraction layer.
3. File transfer protocol.
4. Scheduling algorithms.
5. Provide well-documented source code for all implemented components, including:
1. Process creation and management tools for Linux and Windows.
2. Cross-platform IPC and shared memory mechanism.
3. File transfer utility with security and metadata preservation features.
4. Scheduling algorithm simulations.

Code:
import java.io.*;
import java.nio.file.*;
import java.util.concurrent.*;

public class CrossPlatformResourceManager {

// Process Management Example


public static void createProcess(String command) throws IOException {
ProcessBuilder processBuilder = new ProcessBuilder(command.split("
"));
processBuilder.inheritIO(); // Redirects output and error streams to
the console
Process process = processBuilder.start();
System.out.println("Process started: " + process.info());
}

// Memory Sharing Example (Using File Memory Mapping)


public static void memoryShare(String filePath, String data) throws
IOException {
RandomAccessFile file = new RandomAccessFile(filePath, "rw");
FileChannel channel = file.getChannel();
ByteBuffer buffer = channel.map(FileChannel.MapMode.READ_WRITE, 0,
data.length());
buffer.put(data.getBytes());
System.out.println("Data written to shared memory: " + data);
file.close();
}

// File Transfer Protocol Example (Simple Transfer with Metadata


Preservation)
public static void fileTransfer(String sourcePath, String destPath)
throws IOException {
Path source = Paths.get(sourcePath);
Path destination = Paths.get(destPath);
Files.copy(source, destination, StandardCopyOption.COPY_ATTRIBUTES);
System.out.println("File transferred successfully: " +
source.getFileName());
}

// Scheduling Example (Thread Pool for Task Scheduling)


public static void scheduleTasks() {
ExecutorService scheduler = Executors.newFixedThreadPool(4); //
Example with 4 threads
for (int i = 1; i <= 10; i++) {
int taskId = i;
scheduler.submit(() -> {
System.out.println("Executing Task " + taskId + " on " +
Thread.currentThread().getName());
});
}
scheduler.shutdown();
}

public static void main(String[] args) {


try {
System.out.println("Cross-Platform Resource Manager");

// Process Management
createProcess("echo Cross-platform process creation");

// Memory Sharing
memoryShare("shared_memory.txt", "Shared data between
platforms.");

// File Transfer
fileTransfer("source_file.txt", "destination_file.txt");

// Task Scheduling
scheduleTasks();

} catch (IOException e) {
e.printStackTrace();
}
}
}

Output:
References:
1. Bovet, D. P., & Cesati, M. (2005). Understanding the Linux Kernel.
2. Solomon, D., & Russinovich, M. E. (2009). Windows Internals.
3. Tanenbaum, A. S., & Bos, H. (2015). Modern Operating Systems.
4. Documentation from the Linux kernel and Microsoft Developer Network (MSDN).

This document serves as a foundation for designing a cross-platform DRMS and provides
actionable insights into process management, memory optimization, and file handling across
heterogeneous environments.

You might also like