Category: Simplish

My Major is TCC

Original Blog -> here

Minor differences means that would be Major similarities(and vice versa).

In UNIX, Linux, every I/O operation is done through files (at least conceptually). Files on disks are files but even the peripherals attached to your computer are logically mapped(converted) to files in order to communicate data between them and the user.

Our computer stores the data in two forms

  1. Physical(which the machine understands or in binary form).
  2. Logical(which the user understands or in easy form).

So, here mapping is necessary. To find these files explore the /dev directory.

With each  such device file, there are two numbers associated. These are the major number and the minor number.

A device driver is a program that controls a particular type of device that is attached to your computer. There are device drivers for printers, displays. When you buy an operating system, many device drivers are built into the product. It interface hardware of extreme variety with your operating system.

A peripheral(terminal) can be classified by the kind of driver it uses to interface with the operating system.

Need of Major Number?

There is a reason behind each small thing stored in a computer.

Device files(also known as character special files) a device file that provides serial access (as opposed to a block special device such as a disk drive). For example terminals and serial devices are interfaced through character special files.

Now since there are many drivers residing concurrently inside of your OS kernel, each driver must (can) be uniquely identified with a number. These are your major numbers. Every device file is given the major number of the driver which the device needs (uses). Two files can have the same major number.

Minor Numbers

In order to differentiate with devices having the same major number, we assign them another number which is essentially serves as a serial number for all the devices of the same major. These are your minor numbers.

So, a file representing a device, has with it, two numbers, major and minor. Major represents the driver that device belongs to and Minor represents that device’s unique identity among all the devices with the same major. It is absolutely possible for devices to have the same major and majors to have devices of many minors.

As an example, all USB drives(say 3 files having different minor number) can be thought as devices represented by a USB driver(same major number).

To check these out, use the following command:
ls -l /dev
It’ll have an output similar to this:
 crw-rw-rw-    1 root     root       1,   3 Apr 11  2002 null
 crw-------    1 root     root      10,   1 Apr 11  2002 psaux
 crw-------    1 root     root       4,   1 Oct 28 03:04 tty1
 crw-rw-rw-    1 root     tty        4,  64 Apr 11  2002 ttys0
 crw-rw----    1 root     uucp       4,  65 Apr 11  2002 ttyS1
 crw--w----    1 vcsa     tty        7,   1 Apr 11  2002 vcs1
 crw--w----    1 vcsa     tty        7, 129 Apr 11  2002 vcsa1 

Here c means character special files(device files). The 5th and 6th column show the major and minor numbers (of the files) respectively.



Govind’s blog


A friend in need is a friend indeed means a friend in need is a true friend.

Friendship described with discipline and practiced with immortal faith. True friendship is invaluable and found rarely.

Friendship means exploring beauty of emotions.

Basically, he is trying to correlate the computer world and real world. He is trying to making the base of friend functions through the real life world because he know that our mind holds things in two ways

  1. Visual ways(through pictures).
  2. Base(in Hindi – neev)

He likes C++ language a lot not because he has adapted it’s power or rules rather it is the first programming language he learnt.

He distinctly remember the circumstances leading to this delicious learning journey.

Ohh No, the new semester is going to be start and half book is yet to be read.

The above talk was his past but now again he has keen power to explore beauty of C++

So, below I’ll write the summary of it as you know the motive of writing this blog.

“Computer programming is nothing but a simulation(representation to computer program) of the human mind, experiences, challenges and goals”.

Friends in C++:

A class contains all types of data i.e. public, private, protected. Analogy, there are things that man can share publicly, private(with family members and friends).

To know the secrets of a man be a family member is not so easy and always but being a friend is much easy. Isn’t it?

Just re-declare that function inside the class body (you must not re-define it, that’d be a syntax error) and use the keyword “friend” in this declaration. The re-declaration must be in the public section of the class definition.

Friend function can access the private and protected data of the class through the objects.

The defination of a friend function should be in the same file.
Limitations of Friendship:
  1. Friendship is not implicitly reciprocated. If class A is a friend to class B then the inverse is not true. That would need an explicit desire from the programmer.2. A derived class does not inherit the friendship of its parents. If your parents are friends with someone, then that does not mean you should be friends with them too, does it?
  2. A friend function (or class) cannot be extern. This means that friend functions need to be defined in the same file as their friend class. You cannot declare a function defined in some other file as the friend of a class. Vicinity is a necessity for friendship.
  3. A friend function must not be static because static function are used without objects(contradicts the point of accessing data of class through objects).

Hope I was able to make you clear th objective of his blog.

Thankyou for tolerating me.;)




Hie friends, first of all I’ll tell you why I have made this category.

What is reason(Ground) behind it?

The whole story starts from lack of confidence. Actually, I hesitate to speak in ENGLISH. While giving presentations even I know the whole concept of that topic, then also I fail to make understand that topic clearly to others, due to lack of confidence in speaking English.

Then my Sir gave me an idea to improve my English. He gave a task to me and two three students more on improving English.

So, the one who really want to learn English first stop weeping(being sad) and be a team to start learn English.

What I’ll do is rewrite a blog of my senior Govind in very simple English. That is what the blogs under this category will hold.

The syntax of writing the blogs in the same category would be first I will give his blog reference then, simplify it in a easy English.

Moreover, to learn English from Hindi refer this site

Be Patient:)