Entry Points Routine


 
Thread Tools Search this Thread
Top Forums Programming Entry Points Routine
# 1  
Old 10-07-2002
Entry Points Routine

How do we pronounciate bdevsw and cdevsw Kernel resources ?

I presume it as block or charcter device software table. Am I Correct in my assumption ?

Thanks in advance.
# 2  
Old 10-07-2002
They are tables of entry points to device drivers. All drivers have entries in these tables. The index to the tables is called the major number. By convention, if a device has both a block and character device, the same major number is used for both tables.

For example, if you have a device:
dev_t x;

You can do something like:
(*bdevsw[major(x)].strategy)(bp);

to call the proper strategy routine for the given device. That's how the kernel gets the right driver for the right device.
# 3  
Old 10-08-2002
I do understand that Perderabo. I am working on SCO ver 5.05. SCO has following device driver entry points : close , halt , init , intr , ioctl , open , pminit , poll , print , probe , proc , read , start , strategy , write. Appologies if I am wrong.
I would like reframe my question again :
a)What is the full extension for the kernel resource structure 'bdevsw' and 'cdevsw' . Is it block or charcter device software table or just pronounced as 'bdevsw' and 'cdevsw'.
b)In a streams device driver is it that the all the modules in the driver read and write queue has its own read and write queues. Modules communicate with each other with respect to their read or wirte queues but are confied to the driver's read or write queue modules only. For elaborating my idea I put forward a virtual visual diagram. The pair of driver's read and write queues can be imagined as a pair of set of train tracks.Modules can be thaught as stations capable of doing some processing. It is not necessary that number of modules in write queue be the same in read queue of the driver.The module in the driver write queue can refer to its read/write queue but it cannot refer to the read or write queue's of any module in read queue of the driver.If you are abel to get the picture,is my opinion correct ?

Thanks in advance for all technical helps.

Thanks in advance.
# 4  
Old 10-08-2002
I'll have to take your word for the list of entry points on SCO. It is a longer list than I used to seeing, but I haven't looked at many kernels.

You seem to asking how to verbally pronounce bdevsw and cdevsw. Gosh, I don't know. They're simply variable names. It never occurred to me to attempt to speak them nor have I ever heard anyone else try. It's obvious that the names come from "block device switch" and "character device switch". I hereby opine that the correct pronuciation is "bee dev switch" and "see dev switch" where "dev is pronounced like the first syllable of "devil". But I just made that up.

I am not really a Streams expert, but I *think* that your picture is wrong. First, I think that the modules on the read and write queues do indeed need to match. And in fact I think of it as a single module that simply handles both queues. I'd be a little surprised if I have this wrong.

Second, I am not sure if modules can peek at the queues of other modules or not. The case that has me worried is the need for exceptional processing for flow control. For example, in a tty driver driver, you may need to write an X-off character as soon as the read queues downstream start to back up. I am not at all sure about this, though.
# 5  
Old 10-10-2002
When the UNIX operating system goes to process the open system call, it internally finds out the major number of the file.It uses the major number to index into a table of all of the character drivers installed ( if the file is a character special file ).The declaration within the table contains information in the structure "see dev switch" which has a member variable of type pointer to struct streamtab. The said variable is supposed to contain info about the read and write queues in type structure struct qinit format.The read queue need not have the put procedure while the write need not have open and close procedure.

I am bit confused at this junction. If the read and write queue has different entry points .... the modules on the read and write queues are not matching ? When we insert a module into the stream it is inserted just after the head and modules will be poped out in LIFO way. I am unable to get the full picture clear, the basic being how does the entry points modules linked to the read and write queue and as to how the picture looks like when modules are inserted. Further more where in the picture the "read/write services" fits in with respect to queues?

I know I would be sounding a bit foolish but I need to clear all my doubts at elementary level. Thanks in advance for all your help.
# 6  
Old 10-10-2002
The stream head module has entry points for read, write, open, close, select, and ioctl. These entry points get placed in the cdevsw table and they are called pretty much like any other driver. In the case read and write, the data is coming from or going to buffers in the invoking process. The queue structures are not directly visable to the system calls. The stream head has the job of moving data between the queues and the user's buffers. It also does whatever else it takes to make the stream look like a device driver. This includes error checking the user's parameters and possibly setting errno. In the case a severe user error, it may not even look at the queue structures. Those queue structures are used for module to module communication.
# 7  
Old 10-11-2002
Perderabo , as you say "The stream head module has entry points for read, write, open, close, select, and ioctl." , I just cannot figure it out then why,as I have stated "The declaration within the table contains information in the structure "see dev switch" has a member variable of type pointer to struct streamtab. The said variable is supposed to contain info about the read and write queues in type structure struct qinit format.The read queue need not have the put procedure while the write need not have open and close procedure. ", in my earlier posting, that why at all a read or write queue should be initialized if the stream head module has all the entry points ?

Thanks in advance for all help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to replace multiple "&nbsp;" entry with in <td> tag into single entry using sed?

I have the input file like this. Input file: 12.txt 1) There are one or more than one <tr> tags in same line. 2) Some tr tags may have one <td> or more tna one <td> tags within it. 3) Few <td> tags having "<td> &nbsp; </td>". Few having more than one "&nbsp;" entry in it. <tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies

2. Shell Programming and Scripting

Trying to Parse An Inherited Command/Routine

I am am one of these people that it isn't good enough just to say, "Here, try this...". it is important for me to understand how and why something works (or doesn't work.) All that being said, I am trying to parse out a command that we use that was handed down to me by someone I can no longer... (3 Replies)
Discussion started by: he204035
3 Replies

3. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

4. Shell Programming and Scripting

Do not find the mistake in a small routine!!!

Have a textfile (regular updated) with informations about datafiles . Each line is describing a datafile. Now I am trying to delete several specific lines in this textfile, which are defined before in a kind of removal list. Can not find the mistake I have done in the script because in the... (5 Replies)
Discussion started by: jurgen
5 Replies

5. Shell Programming and Scripting

awk routine help

Hi, I use awk but not as a programming language. Just generally in piplelines to split things out by fields. I am trying to accomplish this one thing that I think a short awk routine would do great for, but can't figure it out. Lets say I have a file that contains database columns. The file... (25 Replies)
Discussion started by: fwellers
25 Replies

6. Shell Programming and Scripting

File exists routine

Hello experts, I need some help here.. I've written the following routine to check for existence of files. The routine does the following. It will look for a compressed ( .Z ) file and if it exists, then it will uncompress it, if it is already uncompressed, then it will just diplay a message... (9 Replies)
Discussion started by: kamathg
9 Replies

7. Shell Programming and Scripting

how to cp files to dir,using routine?

hi all, I wanted to know how we can copy files to dirs, through a routine and when the file and the dir are specified as parameters for that routine and explicitly called? Eg: suppose i want to copy file1 to /tmp then myproc() { . . } myproc /path/file1 /tmp/ These parameters when... (4 Replies)
Discussion started by: wrapster
4 Replies

8. UNIX for Advanced & Expert Users

how to cp files to dir,using routine?

hi all, I wanted to know how we can copy files to dirs, through a routine and when the file and the dir are specified as parameters for that routine and explicitly called? Eg: suppose i want to copy file1 to /tmp then myproc() { . . } myproc /path/file1 /tmp/ These parameters when... (1 Reply)
Discussion started by: wrapster
1 Replies

9. UNIX and Linux Applications

Gnuplot question: how to plot 3D points as colored points in map view?

I have a simple gnuplot question. I have a set of points (list of x,y,z values; irregularly spaced, i.e. no grid) that I want to plot. I want the plot to look like this: - points in map view (no 3D view) - color of each point should depend on its z-value. - I want to define my own color scale -... (0 Replies)
Discussion started by: karman
0 Replies

10. Shell Programming and Scripting

sub routine call

in windows machine... C:\2\test>perl -version This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) ------------------------------------------ what is the difference b\w subroutine calls: sub_routine_name("-----"); and ... (2 Replies)
Discussion started by: sekar sundaram
2 Replies
Login or Register to Ask a Question