├── OSSP_individual_Hana_Asrate_Tigu_bdu1601687_section_b.pdf ├── README.md ├── System_call.pdf ├── installation_of_linux_lite.pdf └── mkdir_custom_syscall.c /OSSP_individual_Hana_Asrate_Tigu_bdu1601687_section_b.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hana-Asrate/Operating-system/7a1cfc593af105c1bd4ab2050e917bc28d9edc02/OSSP_individual_Hana_Asrate_Tigu_bdu1601687_section_b.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linux-Lite-Operating-System 2 | 3 | This is a documentation project about learning and working with the Linux Lite operating system. It includes installation steps using VirtualBox, a system call (`mkdir()`) implementation in C, and explanations of core OS concepts. 4 | **[View Full PDF Documentation](OSSP_individual_Hana_Asrate_Tigu_bdu1601687_section_b.pdf)** 5 | 6 | ## OS Installation 7 | 8 | This section provides a complete guide for installing the Linux Lite operating system in a virtual environment using VirtualBox. It includes steps for setting up the virtual machine, allocating resources, and completing the installation process. Common issues like system freezes were resolved by adjusting memory and processor settings. It also discusses system requirements, supported filesystems, and advantages/disadvantages of using Linux Lite. 9 | 10 | ## mkdir() System Call Implementation 11 | 12 | This section demonstrates the implementation of the `mkdir()` system call in the Linux Lite environment using the C programming language. It explains the necessary headers, permission flags, compilation using `gcc`, and execution via terminal. The sample code creates a directory and prints success or failure based on the result. This is ideal for learners exploring filesystem-level system calls in Linux-based systems. 13 | -------------------------------------------------------------------------------- /System_call.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hana-Asrate/Operating-system/7a1cfc593af105c1bd4ab2050e917bc28d9edc02/System_call.pdf -------------------------------------------------------------------------------- /installation_of_linux_lite.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hana-Asrate/Operating-system/7a1cfc593af105c1bd4ab2050e917bc28d9edc02/installation_of_linux_lite.pdf -------------------------------------------------------------------------------- /mkdir_custom_syscall.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | SYSCALL_DEFINE2(mkdir_custom, const char __user *, pathname, umode_t, mode) 9 | { 10 | struct path path; 11 | struct dentry *dentry; 12 | char *kernel_pathname; 13 | int error; 14 | 15 | // Allocate memory for the pathname 16 | kernel_pathname = kmalloc(PATH_MAX, GFP_KERNEL); 17 | if (!kernel_pathname) 18 | return -ENOMEM; 19 | 20 | // Copy the pathname from user space to kernel space 21 | if (strncpy_from_user(kernel_pathname, pathname, PATH_MAX) < 0) { 22 | kfree(kernel_pathname); 23 | return -EFAULT; 24 | } 25 | 26 | // Lookup the path to create the directory 27 | dentry = kern_path_create(AT_FDCWD, kernel_pathname, &path, LOOKUP_DIRECTORY); 28 | if (IS_ERR(dentry)) { 29 | kfree(kernel_pathname); 30 | return PTR_ERR(dentry); 31 | } 32 | 33 | // Lock the inode to prevent race conditions 34 | inode_lock(d_inode(path.dentry)); 35 | 36 | // Attempt to create the directory with given mode 37 | error = vfs_mkdir(d_inode(path.dentry), dentry, mode); 38 | 39 | // Unlock the inode and release path resources 40 | inode_unlock(d_inode(path.dentry)); 41 | done_path_create(&path, dentry); 42 | 43 | // Free allocated memory 44 | kfree(kernel_pathname); 45 | 46 | return error; 47 | } 48 | --------------------------------------------------------------------------------