LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-30-2004, 02:21 PM   #1
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
block drivers... holy fsck??!!!


i've been reading 'linux device drivers' for a bit now, learned so much cool stuff from it. i've written a couple char drivers and done lots of fun module hacking; it was tuff but after lots of trial and error i feel i understand it all pretty well. anyhow, i started reading chapter of block drivers today, and CRAP!!!! this stuff is REAAAALY complicated! all the drivers in the [ /drivers/block ] directory are huge, there seems to be nothing that i can browse thru comfortably like with char drivers. even the floppy driver is 4000+ lines of code. so im wondering if any of u guys have written a block driver? im debating whether or not i should skip this chapter and start on the dma/memory management chapter and then finally the network card chapter. the main reason i started this book was b/c i really wanted to learn to write a wireless card driver. atm, my first impression is telling me im going to spend a huuuuuge amount digesting and writing a block driver first tho. am i just bein a little biatch(feel free to call me out ) or is this stuff as complex as my first read has told me? my main worry is the fact that any block driver has to be extremely efficient, and it seems like to write an efficient one there is a ton of kernel code that needs be understood first. commments...?
 
Old 04-30-2004, 02:29 PM   #2
kooch
Member
 
Registered: Mar 2004
Location: Upstate NY
Distribution: Slackware/YDL
Posts: 77

Rep: Reputation: 15
I would recommend digging through it. If nothing else you'll become a better code reader.

Just remember; everything you're working on is _very_ complex and it will take 99.9% of the people in the world significant effort to understand the material. Try not to become discouraged.

It might be beneficial to keep a notebook with filenames, line numbers and notes regarding whatever driver you are studying.
 
Old 05-14-2004, 05:32 PM   #3
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Original Poster
Rep: Reputation: 30
ok i/ve read this chapter quite a number of times, and it wasn't as bad as i had originally percieved it. i still haven't yet dug into the floppy.c yet, but that's my next step. i have a question tho, i certainly want to write a driver of my own - my goal is to write one of each driver type(char/block/net). i have a camera that plugs into USB port, so in order to write driver i know i'll first have to learn USB protocol but i have some great links for that already. i have been doing some googling, and all the things i see about USB cameras have people 'mount'ing the camera, so am i correct to assume that digcams are block devices?? has anyone written a camera driver?
 
Old 05-14-2004, 08:28 PM   #4
kooch
Member
 
Registered: Mar 2004
Location: Upstate NY
Distribution: Slackware/YDL
Posts: 77

Rep: Reputation: 15
I believe a USB camera connection would behave just like a USB hard drive or thumb drive. So yes I think they are a block device.(can't really verify at the moment as my internet connection is getting 90% packet loss)
 
Old 05-14-2004, 09:32 PM   #5
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Original Poster
Rep: Reputation: 30
is ur router is munching on packets? my linksys goes berserk once every few months and starts eating packet headers for lunch, unpluggin/repluggin the pos does the trick.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fsck.ext3: Attempt to read block from filesystem trouble dolphans1 Mandriva 12 10-07-2009 04:30 AM
Holy Nvidia Drivers Batman! Nego Linux - Hardware 5 07-08-2004 01:49 AM
automatic fsck on boot. fsck errors. nixel Slackware 1 05-17-2004 07:51 AM
for the love of all this is holy pls help oneiric Linux - Newbie 8 07-15-2003 11:33 PM
Holy COW! tcaptain General 15 03-06-2003 03:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration