Navid Malekghaini's Personal Blog

My personal weblog for sharing and storing some of my activities related to computer science over the internet

Navid Malekghaini's Personal Blog

My personal weblog for sharing and storing some of my activities related to computer science over the internet

Navid Malekghaini's Personal Blog

Navid Malekghaini

Software Engineer @ Intelligent Cloud Infrastructure Laboratory
Prev. ML Researcher @ University of Waterloo x Orange Telecom

University of Waterloo
Department of computer science
200 University Ave W, Waterloo, ON N2L 3G1, Canada
cs.uwaterloo.ca

contact me
navidmalekedu (AT) gmail (DOT) com [ Primary Email ]
nmalekgh (AT) uwaterloo (DOT) ca

۳ مطلب با کلمه‌ی کلیدی «os» ثبت شده است

1) what is pipe?

Pipe man page :

«pipe()  creates  a pipe, a unidirectional data channel that can be used for interprocess communication. The array pipefd is used to return two file  descriptors  referring to the ends of the pipe. pipefd[0]  refers  to the read end of the pipe. pipefd[1] refers to the write end of the pipe.  Data written to the write end of  the pipe is buffered by the kernel until it is read from the read end of the pipe. For further details, see pipe(7).»

 

2)Creating half-duplex communication between parent and child:


 

the code and output:


 

description:

The child closes it’s write (fd[1]) and then reads from fd[0] into readForChild buffer and prints the output.

The parent closest it’s read(fd[0]) and then writes into writeForParent buffer and then passes the address to the fd[1].

 

 

More complicated Half-Duplex communication:

 

read comments for better undrstanding.

موافقین ۰ مخالفین ۰ 13 August 17 ، 10:21

Part 1.2

finding the important functions which gather information about some hardware's

DOWNLOAD FULL TUTORIAL WITH IMAGES FROM HERE

 

list of hardwares:

  • CPU

  • Memory

  • network interface

  • sound card

  • power supplier

inorder to implement our information on system we should find :

  1. what are the type of variables we want?

  2. What is implementing them?

  3. Where are they defined?

  4. How to implement from number 2, to number 1?

so in this part we have to answer these 4 questions.

 

DOWNLOAD FULL TUTORIAL WITH IMAGES FROM HERE

 
موافقین ۰ مخالفین ۰ 14 July 17 ، 03:12




in these series of tutorials i want to play with Linux kernel and Loadable Kernel Modules (LKM) along with getting basic information about kernel architecture and system calls (part 1) , proc file system and processes information's (part 2), these tutorials are adopted from my operating system's class project.

there are two major parts as i mentioned before:

 
  1. Linux kernel (focusing on system calls)
  • Building kernel from source with adding a simple system call
  • Finding specified devices information and necessary functions to implement them
  • How to implement the system call and user space program to get info on specified drivers from kernel

     2. Loadable Kernel Modules (focusing on Proc File system)

  • Implementation of simple “hello world” module and run
  • Finding specified information and necessary functions to implement desired module
  • Implementation of desired kernel module and user program

requirements:

  • Ubuntu version: 16.04.2 (recommended not required)

  • Linux kernel : 4.x.x

  • Internet connection

  • about 30 or 40 gigabytes of space (first part)

  • lots of time for compile ! (first part)



i will start from the simple system call in the next post.

navidx
موافقین ۰ مخالفین ۰ 11 July 17 ، 06:12