Showing posts with label Operating system. Show all posts
Showing posts with label Operating system. Show all posts

Thursday, March 30, 2017

What is Apple file system(APFS)!!!


Apple announced its new file system called Apple File System(APFS) at WWDC2016. Lets see what are new features in APFS and why apple introduced this new file system.

Till now apple is using file HFS+(Hierarchal file system). The problem with this file system is, it designed almost three decades back and it designed basing on the existing drives(HDD's, FlopDisks) on that time. Though HFS+ supports latest SSD, Flash drives, it is not efficient enough. To support all these, Apple introduced new file system called Apple File System. Below are the some of the key features of APFS.

  • To make single file system for all apple OS (macOS, iOS, watchOS and tvOS)
  • To support and take advantage of SDD and Flash memory disks
  • 64-bit support
  • Encryption first
  • Space sharing- if partition the disk, this file system will automatically adjusts the memory if one partition has no space
  • Feel fast access by reducing the latency - as SSD and flash disks wont have any spinning needle to read/write unlike HDD's.
  • Snap shot and clones - copying and moving files are quick
  • Less OS Space
This file system will be available from iOS 10.3, macOS 10.12.4. When users upgrades to 10.3 it version, it will automatically converts file system from existing HFS+ to new Apple File system. Though this conversion will not effect your data, its advised to take the back up before upgrading iOS 10.3


Happy Upgrading!!!

Thursday, August 15, 2013

The Unix file system!!


The Unix file system is divided into four sequential blocks namely Boot block, Super block, Inode block and the data block as shown below. In all the blocks except data blocks, all are fixed at the time of creation. and data blocks will be changed when the file content is changed.


The Boot Block: This block is starting of the file system and booting code (bootstrapping) will be stored here.Each file system should have one boot block to boot the system. Only one boot block is need to boot the system and if you have more than one file systems, other boot blocks will be empty. So for starting the machine, Operating systems reads the data from boot block to load.
The Super Block: This block specifies the status of the file system. It provides the information like how much space available, how large the file system, total size of the disk, total used blocks, bad blocks etc.
The Inode Block: This blocks specifies the information about the files. each file will have one unique inode (information node) on the disk. The inode contains the information like owner of the file, file type, permissions of the file etc.
The Data Blocks: This block starts immediately after the inode block and this block contains actual data or file content. It also contains other files which contains user data like FIFO, regular files, directory files, character special , block special and socket files etc.

I will post in detail about the Inode structure later.



Tuesday, August 14, 2012

C Program to create threads!!

Below is the simple C program to create the thread.
#include<stdio.h>
#include<pthread.h>
void *print_data(void *str)
{
 char *msg = (char *)str;
 printf("given message is '%s'\n",msg);
}
main()
{
 pthread_t th1,th2;
 int ret1,ret2;
 char msg1[]="this is first message";
 char msg2[]="this is second message";
 ret1 = pthread_create(&th1,NULL, print_data,(void *)msg1);
 ret2 = pthread_create(&th2,NULL, print_data,(void *)msg2);
 printf("th1 return value is %d\n",ret1);
 printf("th2 return value is %d\n",ret2);
 pthread_join(th1,NULL);
 pthread_join(th2,NULL);
}

Tuesday, February 14, 2012

Memory organization in C programming language


Memory is organized in four segments namely text, data, heap and stack segments.

Text segment: This is also called the code segment. all the text will be stored here.

data segment: All the data will be stored here. this segment diveded into BSS and non-BSS portions. In BSS (Block Started by Symbol) all uninitialized static and global variables stored. and initialized and constant variables will be stored in non-BSS portion.

stack segment: All the local variables will be stored here. during the fucntion call stack segment will be used to store the function return address and the local

variables of that function.

Heap segment: this is used for dynamic memory allocation. this memory area can be used by calling malloc, calloc functions.

See the below images for more clarity:


General memory organization




Unix & Windows




Subscribe to: Posts (Atom)

Popular Posts

AltStyle によって変換されたページ (->オリジナル) /