Go Back   nV News Forums > Software Forums > Software Development

Newegg Daily Deals

Reply
 
Thread Tools
Old 01-03-10, 02:43 PM   #1
CompUser101
Registered User
 
Join Date: Jan 2010
Posts: 11
Default Driver writing and assemblyish things. The old fashion way?!

Any info on where you can still learn this sort of thing. I want to pickup where I left off like 10-15 years ago with trying to learn programming (really learn programming) myself. Where can you get system info to understand what you are writing them to do and where can you learn enough about systems still to learn every aspect of how the languages are setup. Particularly in relationship to the hardware.

I know the commands for x86 mildly. There's not much there. from some of the tutorials i've seen. some general registers low high part of the byte etc(I know there is more. I used to know a little more about them I think. Vaguely). I'm still missing information to learn it all very thoroughly let alone try to put any into practice.

I hate trying to learn these things with only partially or non existant info. this info used to be as common as grass. How do they expect there to be more programmers in the future if they don't let anyone learn anything. Haveing a small amount of expert*cough*hack*cough* programer is not and never will get the computer feild anywhere. And since I own a computer I'd still prefer to get to learn everything about it to use it. Screw the software companies.

BTW especially free resources. 8)

I've never seen a book I like. And they are less adaptable than free things on the internet since they can be edited to improve them more easily. I consider them superior. Not to mention the books are all outrageiously overpriced and never have anywhere near the info I want or need. So I gave up on that root entirely.

Last edited by CompUser101; 01-05-10 at 04:34 PM.
CompUser101 is offline   Reply With Quote
Old 01-04-10, 11:35 AM   #2
FlakMagnet
Registered User
 
FlakMagnet's Avatar
 
Join Date: Mar 2005
Location: Farnborough, UK
Posts: 335
Default Re: Driver writing and assemblyish things. The old fashion way?!

The trouble is, writing books/tutorials to cover what you are looking for is a huge job, and if someone takes the time and effort to do it well, they will probably want to sell it in book form.

Developing device drivers is a very complex task, and one which is difficult with free tools (as far as I am aware, there are no free tools that make Windows device driver development easy).

The place I would look for documentation would be MSDN. Look for WDK (Windows Driver Kit) and you should find something useful.

Just one word of warning about Vista and Windows 7 - you cannot install a device driver unless it has been 'signed' by Microsoft. However, this process costs money and is normally not an option for people developing drivers as a 'hobby'.

Some useful information can be found here : http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx
__________________
ASUS P6T Deluxe V2 | i7 920 @ 3.6GHz
POV GTX480 | 6GB Patriot DDR3 @1443
X-Fi Fatal1ty Pro | 120GB OCZ Vertex SSD
2xSamsung 7200 750GB RAID 0| Akasa Eclipse 62
FlakMagnet is offline   Reply With Quote
Old 01-05-10, 04:32 PM   #3
CompUser101
Registered User
 
Join Date: Jan 2010
Posts: 11
Default Re: Driver writing and assemblyish things. The old fashion way?!

aren't windows device drivers still written in assembly? Assembly is free. I'm talking about older drivers not just newer ones. I can get an old pc and write them for windows 3.1 or something. Or linux if I learn the OS finally. And as far as I know driver writting was farely common in the past. When I first got internet access assembly was still written in as normal practice to learn to program thoroughly. And learning to write a driver was one of the top things listed to always learn to do.

I'm looking for really old stuff too..... I don't need anything modern. That used to always be free.

I figured you had a forum on programming you would enjoy talking about programming. I was hoping the find the old gunho attitude that was always the basis of the programing community.
CompUser101 is offline   Reply With Quote
Old 01-06-10, 08:32 AM   #4
FlakMagnet
Registered User
 
FlakMagnet's Avatar
 
Join Date: Mar 2005
Location: Farnborough, UK
Posts: 335
Default Re: Driver writing and assemblyish things. The old fashion way?!

I think most drivers are now written in C/C++. There might be some areas of a driver that needs to be written in assembly, but I imagine developers avoid it if possible - it' just so much easier developing and debugging in C/C++. And because Windows 3.1 is very old, I don't think you'll find many developers still writing drivers for it.

One reason why assembly is not as popular any more is that computers are so much faster than they used to be. In 'the good old days' developers had no choice but to write device drivers in assembly to make them as quick as possible, but now, languages such as C and C++ as sufficient. Modern CPUs run C++ compiled code very well, and is actually very difficult to write assembly that will be quicker than the compiled C++ equivalent. Modern compilers optimise very well.

I wrote a driver for a high speed capture card entirely in assembly language for Windows 3.11 quite a few years back, but things were a lot easier back then. Windows was nowhere near as 'secure' as recent versions, and it was fairly simple to allocate yourself a DMA channel and blat data into memory without having to worry too much about what the OS might think of you doing that.

On modern OSes, I imagine there are tools and driver 'templates' that start you off in the right direction and you just have to fill the gaps with your device's specific features and requirements. If you look at some of the documents on the MS site I linked to, you will see that writing a device driver has been made significantly easier because MS has supplied the WDK. I think one of the quotes in the documentation said that there are over 100 power states in recent Windows OSes, and until the WDK became available, you had to code for each of them in your driver! Eek!

If you want to write software in assembly language as a learning exercise, I wouldn't write a device driver because:

1. They can be difficult to debug.
2. You can crash the OS if you get it wrong.
3. Unless you are going to get a job writing assembly language, you won't ever need to use it. I've been developing now for over 25 years and started in C and Assembly language on a Z80 machine running CPM, but I can't remember the last time I had to write assembly language.

If it is just a learning exercise, I would seriously look at C++ instead. You will find free tools both on Windows and Linux to help you develop in C++ and I think you'll have a much more enjoyable experience doing it. If you want to look at higher level languages, I suggest either Java or C#. Again, tools are freely available for development in Java and C# (although C# is limited to Microsoft OSes, Java is cross platform).

If you are still determined to develop device drivers in assembly language, then I wish you all the best (being serious). I loved developing in assembly language - I think it's still my favourite part of my career so far, but I wouldn't like to develop the kinds of application I am now developing in assembly language - that would be torture
__________________
ASUS P6T Deluxe V2 | i7 920 @ 3.6GHz
POV GTX480 | 6GB Patriot DDR3 @1443
X-Fi Fatal1ty Pro | 120GB OCZ Vertex SSD
2xSamsung 7200 750GB RAID 0| Akasa Eclipse 62
FlakMagnet is offline   Reply With Quote
Old 01-07-10, 06:59 PM   #5
CompUser101
Registered User
 
Join Date: Jan 2010
Posts: 11
Default Re: Driver writing and assemblyish things. The old fashion way?!

The main reason is because I wanted to work in tangeant with it to learn hardware design also. I figured It might help kill sever birds with two stones. You have to consider the hardware to write the drivers correct?! So I could learn both in the process possibly and then do whatever with the knowledge. And I think I would like writing in assembly personally. I'd probably for the heck of it turn it into a high level language and write libraries for it anyway. I've always wanted to do that. Either way I still need a lot of the other knowledge like hardware I think to figure out how to write certain things. I think most of my ideas of programing are a bit old but I'd love to try them one day. So I'd like to start learning as broadly as possible. And as thoroughly.]

To work on the driver stuff I would start trying to do something like kernels or drivers in linux but I dont' think they support it as much either and I'm used to windows. I have xp and 3.1 and an old comp i can do anything to I want. So it may not be a big deal. I would love to write some (when I am capable) and try to get the modems and stuff to work.

Also I keep holding onto older stuff because I get the feeling you don't learn it anymore. And I don't want to get some partial education or anything and never have the capability to work on certain things that I possibly could have. (not necessarily in a job. Just privately. Maybe I could do something with it one day. Directly or indirectly.) And I can never fully stand high level languages. I don't want to use them till I know assembly and learn the languages in more detail. When I know them fully then I'll use them. but it drives me nuts blindly writing things in them. I don't like the learn by feeling my way through if that makes sense.

Also part of hte issues for me is I started learning about 15 years ago. Did the normal thing learning languages lightly. I usually stopped part way since I had nothing to do with them.(probably why I want assembly. There are more direct goals i know to program. and one I want to learn.) When I started learning stuff in general about computers there were a lot of things to read about and a lot of it isn't available anymore. Especially general computer design cpu design graphics design, etc. Hardware and software. And I'm trying to pick back up and get a fully thorough background in at least those things.

I am in a bachelors degree for Computer science so I will be learning it. I'm actually trying to figure if I should do what they call a CSET(computer science and engineering tech) which from what I know is lower end math and more geared towards things like administrating, and CSE computer science engineering which is geared towards higher calculus and more theoretical things as they say. So hopefully I'll learn a lot in it, but I'm worried I won't learn everything I have been wanting to for so long and I want to go over these things regardless. And it would be particularly nice to get to go over them if I can find them before i hit those classes. Then I can incorporate the knowledge in them what I want and hopefully have an easier time taking the class in and using the knowledge. If any of that makes sense.

Edit: I've seen lots of tutorials on assembly saying, lets say, what registers are but I have not gotten the chance to understand them in full on the hardware level to know how to utilize them. Or at the least take a really good stab at it. and start learning. I can never find the base information to work my way up.. So far from what I've seen none of it is that complicated. I know it would be easier if it was studied it in whole. I've known that since the start. But i can't find the info to learn it. There isn't a lot of literal information( I consider it qaulity information) to study using real hardware and problems, designs, and purposes in those designs. I could go on forever about it if I could find the words.

I was going to start using linux also but I was a very hard time finding the basic info to use it. Even syntex and the file system. It was ridiculous.
CompUser101 is offline   Reply With Quote
Old 01-10-10, 02:43 AM   #6
FlakMagnet
Registered User
 
FlakMagnet's Avatar
 
Join Date: Mar 2005
Location: Farnborough, UK
Posts: 335
Default Re: Driver writing and assemblyish things. The old fashion way?!

I think I understand now what your goal is, and I must say, I'm very impressed that you want to learn how the low-level stuff works before learning about the higher level. Too many people that I encounter in my business today just don't understand about hardware, assembly language, registers, ports, I/O, DMA etc. I could be wrong, but most university courses today don't cover those things, but instead cover languages such as COBOL, C/C++, Java etc.

I think having a good understanding of the basics makes you a better overall developer.

As I said in an earlier post, I haven't used assembly language for a few years now, and some of the books I have (probably most) are just out of date. But they were useful at the time By the way, Intel have full documentation for their processors on their web site. I looked the other day at the latest instruction set for the i7, and was amazed how much has been added since my 386 days! The Intel documents are usually very well written and are invaluable to any assembly programmer.

Link to i7 details on Intel site : http://developer.intel.com/products/...uals/index.htm

You can find links to other processors from there.

I din't think I've ever read a book that detailed how to interface to hardware including examples etc. What I used to use was the datasheets specific to individual chips, and the information from the guys building the hardware - they would tell me where specific chips were mapped into memory, or what port numbers I could access them on. So if you were thinking or writing a driver for an old modem for example, you would need the datasheets on the chips used on the card, the address the card was mapped to in memory, and any I/O ports. Not sure it would be easy to find that stuff for old hardware though.
__________________
ASUS P6T Deluxe V2 | i7 920 @ 3.6GHz
POV GTX480 | 6GB Patriot DDR3 @1443
X-Fi Fatal1ty Pro | 120GB OCZ Vertex SSD
2xSamsung 7200 750GB RAID 0| Akasa Eclipse 62
FlakMagnet is offline   Reply With Quote
Old 01-16-10, 05:58 PM   #7
LydianKnight
Registered Knight
 
LydianKnight's Avatar
 
Join Date: Jan 2009
Location: Málaga, Spain
Posts: 977
Default Re: Driver writing and assemblyish things. The old fashion way?!

Quote:
Originally Posted by CompUser101 View Post
The main reason is because I wanted to work in tangeant with it to learn hardware design also. I figured It might help kill sever birds with two stones. You have to consider the hardware to write the drivers correct?! So I could learn both in the process possibly and then do whatever with the knowledge. And I think I would like writing in assembly personally. I'd probably for the heck of it turn it into a high level language and write libraries for it anyway. I've always wanted to do that. Either way I still need a lot of the other knowledge like hardware I think to figure out how to write certain things. I think most of my ideas of programing are a bit old but I'd love to try them one day. So I'd like to start learning as broadly as possible. And as thoroughly.]

To work on the driver stuff I would start trying to do something like kernels or drivers in linux but I dont' think they support it as much either and I'm used to windows. I have xp and 3.1 and an old comp i can do anything to I want. So it may not be a big deal. I would love to write some (when I am capable) and try to get the modems and stuff to work.

Also I keep holding onto older stuff because I get the feeling you don't learn it anymore. And I don't want to get some partial education or anything and never have the capability to work on certain things that I possibly could have. (not necessarily in a job. Just privately. Maybe I could do something with it one day. Directly or indirectly.) And I can never fully stand high level languages. I don't want to use them till I know assembly and learn the languages in more detail. When I know them fully then I'll use them. but it drives me nuts blindly writing things in them. I don't like the learn by feeling my way through if that makes sense.

Also part of hte issues for me is I started learning about 15 years ago. Did the normal thing learning languages lightly. I usually stopped part way since I had nothing to do with them.(probably why I want assembly. There are more direct goals i know to program. and one I want to learn.) When I started learning stuff in general about computers there were a lot of things to read about and a lot of it isn't available anymore. Especially general computer design cpu design graphics design, etc. Hardware and software. And I'm trying to pick back up and get a fully thorough background in at least those things.

I am in a bachelors degree for Computer science so I will be learning it. I'm actually trying to figure if I should do what they call a CSET(computer science and engineering tech) which from what I know is lower end math and more geared towards things like administrating, and CSE computer science engineering which is geared towards higher calculus and more theoretical things as they say. So hopefully I'll learn a lot in it, but I'm worried I won't learn everything I have been wanting to for so long and I want to go over these things regardless. And it would be particularly nice to get to go over them if I can find them before i hit those classes. Then I can incorporate the knowledge in them what I want and hopefully have an easier time taking the class in and using the knowledge. If any of that makes sense.

Edit: I've seen lots of tutorials on assembly saying, lets say, what registers are but I have not gotten the chance to understand them in full on the hardware level to know how to utilize them. Or at the least take a really good stab at it. and start learning. I can never find the base information to work my way up.. So far from what I've seen none of it is that complicated. I know it would be easier if it was studied it in whole. I've known that since the start. But i can't find the info to learn it. There isn't a lot of literal information( I consider it qaulity information) to study using real hardware and problems, designs, and purposes in those designs. I could go on forever about it if I could find the words.

I was going to start using linux also but I was a very hard time finding the basic info to use it. Even syntex and the file system. It was ridiculous.
The funny thing is your first choice was right, I mean...

The vast majority of Linux drivers are open-source (not all, of course), so you can get an idea about how a driver works, and being for Linux doesn't have anything to do per se, in the sense that you can learn how the registers are written/read to/from.

The site FlakMagnet has pointed you out is also a very good source of information, and you should understand the basics of processor register/instruction set before you attempt to code anything further (at least, in my opinion).

About the file system, what's your problem with it? I mean... Linux inherits the most common UNIX principle: 'everything is a file'. A device and a regular file are represented by exactly the same entity, and a regular fopen() does the trick (usually).
LydianKnight is offline   Reply With Quote
Reply


Thread Tools

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 On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:47 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©1998 - 2014, nV News.