How to program for Hardware / Operating System?

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 2090 Views - Last Post: 13 December 2013 - 02:27 PM

#1 newyear498  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 11-December 11

How to program for Hardware / Operating System?

Posted 23 November 2013 - 03:26 PM

I appreciate your help,

I would like to learn how to develop directly for the hardware on my computer or raspberry pi, however I have no idea where to start.

I've taken courses in assembly and C, but I don't know how to connect everything together and design and control the hardware directly.

additionally I am interested in developing my own operating system on a super small simple scale but I cannot find any decent guides on this topic since most guides only talk theory, I really need a step by step system.


I would love to program for my raspberry pi make it boot up to a simple text shell and handle a few simple commands, additionally if I learned how to code and make the network devices talk over the internet etc, thats what I'm aiming for.


Thank you!

Is This A Good Question/Topic? 0
  • +

Replies To: How to program for Hardware / Operating System?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9044
  • View blog
  • Posts: 33,951
  • Joined: 12-June 08

Re: How to program for Hardware / Operating System?

Posted 23 November 2013 - 04:40 PM

Have you looked at the basic tutorials?

http://www.raspberry...s/tag/tutorials
http://learn.adafrui...ry/raspberry-pi
Was This Post Helpful? 0
  • +
  • -

#3 newyear498  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 11-December 11

Re: How to program for Hardware / Operating System?

Posted 23 November 2013 - 04:47 PM

View Postmodi123_1, on 23 November 2013 - 04:40 PM, said:



Those are nice tutorials but I guess what I'm trying to find is something more advanced that deals with writing device drivers or something, I don't want to use the linux OS for raspberry pi but rather write the code necessary to control the memory and cpu that comes with the raspberry pi with my own code soley. I want an in depth full understanding.

thanks
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9044
  • View blog
  • Posts: 33,951
  • Joined: 12-June 08

Re: How to program for Hardware / Operating System?

Posted 23 November 2013 - 05:48 PM

Not to be that guy, but searching : "how to writing operating system for raspberry pi" yielded:

http://www.cl.cam.ac...i/tutorials/os/
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5464
  • View blog
  • Posts: 11,731
  • Joined: 02-June 10

Re: How to program for Hardware / Operating System?

Posted 23 November 2013 - 06:42 PM

I'm going to point out that writing drivers, just the drivers not counting the OS, requires a really deep understanding of the device on a really low level.

And you're saying to want to do that for... The CPU, the network card, the video card, the audio card, the USB chipset [...]

I'll tell ya what.... Write a driver for your current computer's audio card. Uninstall the current driver and write your own. See how long that takes you. No. Really. Just do that much to see if you can and if you are really ready to tackle a project of only one driver before you try 20 plus an OS.

Now multiply that effort for every device you need. Now multiply that collective time by 30 for the base OS. Is the total time it will take still within the average lifespan of a person? Is it even in the expected lifespan of the computer you are going to run it on... or are you talking about 20 man-years of work for a computer that will effectively be the computing power of a wristwatch in 5 years?

Ya see, there is a reason why these things are done by teams of people. What will take you 5 years by yourself, would take 5 men, 1 calendar year. Hense the term man-years.

So like I suggested... Start with just 1 driver on an already working OS. If it turns out you LOVE doing that then great; keep going. I'm just saying to manage your expectations and not set yourself up for 20 drivers and an OS before you tackle even one device.
Was This Post Helpful? 0
  • +
  • -

#6 newyear498  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 11-December 11

Re: How to program for Hardware / Operating System?

Posted 23 November 2013 - 06:49 PM

View PosttlhIn`toq, on 23 November 2013 - 06:42 PM, said:

I'm going to point out that writing drivers, just the drivers not counting the OS, requires a really deep understanding of the device on a really low level.

And you're saying to want to do that for... The CPU, the network card, the video card, the audio card, the USB chipset [...]

I'll tell ya what.... Write a driver for your current computer's audio card. Uninstall the current driver and write your own. See how long that takes you. No. Really. Just do that much to see if you can and if you are really ready to tackle a project of only one driver before you try 20 plus an OS.

Now multiply that effort for every device you need. Now multiply that collective time by 30 for the base OS. Is the total time it will take still within the average lifespan of a person? Is it even in the expected lifespan of the computer you are going to run it on... or are you talking about 20 man-years of work for a computer that will effectively be the computing power of a wristwatch in 5 years?

Ya see, there is a reason why these things are done by teams of people. What will take you 5 years by yourself, would take 5 men, 1 calendar year. Hense the term man-years.

So like I suggested... Start with just 1 driver on an already working OS. If it turns out you LOVE doing that then great; keep going. I'm just saying to manage your expectations and not set yourself up for 20 drivers and an OS before you tackle even one device.


Thank you,

I'm just interested in a very simple system, I'm not very sure where to begin with one driver thats why I was asking :)
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5464
  • View blog
  • Posts: 11,731
  • Joined: 02-June 10

Re: How to program for Hardware / Operating System?

Posted 23 November 2013 - 07:13 PM

HUH? You don't know where to start with even a single driver... So you thought it would be easier to build the entire OS?

<Bill and Ted voice> Like duuuuude... I don't know what you're sprinkling on your Cheerios.... But like man, fer sure you need to be sharing with the rest of us... Its rude to be Bogarting the good stuff like that. </Bill and Ted voice>

There are dozens of hardware kits out there. Buy a kit that connects to your serial port and lets you control a some LEDs and recognize if switches are opened or closed, and lets you open and close relays in order to turn external hardware off and on. That is about as simple of a hardware controller as you can get.

After that... Find a USB Weather station kit. Write a controller for it. Again its very straight forward because it is just reading data, parsing it to something human digestable, and displaying it.

Google "PC controller kit"... and variations on it.
You should get results for things like:


You can then work up to simple single-board computers like:
http://www.kickstart...ny-single-board
Was This Post Helpful? 0
  • +
  • -

#8 newyear498  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 11-December 11

Re: How to program for Hardware / Operating System?

Posted 24 November 2013 - 09:32 AM

View PosttlhIn`toq, on 23 November 2013 - 07:13 PM, said:

HUH? You don't know where to start with even a single driver... So you thought it would be easier to build the entire OS?

<Bill and Ted voice> Like duuuuude... I don't know what you're sprinkling on your Cheerios.... But like man, fer sure you need to be sharing with the rest of us... Its rude to be Bogarting the good stuff like that. </Bill and Ted voice>

There are dozens of hardware kits out there. Buy a kit that connects to your serial port and lets you control a some LEDs and recognize if switches are opened or closed, and lets you open and close relays in order to turn external hardware off and on. That is about as simple of a hardware controller as you can get.

After that... Find a USB Weather station kit. Write a controller for it. Again its very straight forward because it is just reading data, parsing it to something human digestable, and displaying it.

Google "PC controller kit"... and variations on it.
You should get results for things like:


You can then work up to simple single-board computers like:
http://www.kickstart...ny-single-board


Have you built a simple os before?

I am only looking for what I need to know, good sources to study, and how to lead myself towards this direction so I have have a better understanding in the long run.
Was This Post Helpful? 0
  • +
  • -

#9 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5224
  • View blog
  • Posts: 26,990
  • Joined: 10-May 07

Re: How to program for Hardware / Operating System?

Posted 24 November 2013 - 09:57 AM

View Postnewyear498, on 23 November 2013 - 09:49 PM, said:

I'm just interested in a very simple system

The way I read it, you're interested in an easy system. Easy & simple are not the same thing from a development standpoint. A simple system would be using an existing Linux solution, & learning from there. However you're asking for tutorials, I suppose so you can duplicate the effort, compile, & call it yours.

I don't think what you're actually asking for is for learning. It's for doing. As suggested, re-creating existing solutions of your own effort would teach you, & then you can move on.

Just how I see this topic, & many many others that sing a similar tune.
Was This Post Helpful? 1
  • +
  • -

#10 newyear498  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 11-December 11

Re: How to program for Hardware / Operating System?

Posted 24 November 2013 - 10:28 AM

View Postno2pencil, on 24 November 2013 - 09:57 AM, said:

View Postnewyear498, on 23 November 2013 - 09:49 PM, said:

I'm just interested in a very simple system

The way I read it, you're interested in an easy system. Easy & simple are not the same thing from a development standpoint. A simple system would be using an existing Linux solution, & learning from there. However you're asking for tutorials, I suppose so you can duplicate the effort, compile, & call it yours.

I don't think what you're actually asking for is for learning. It's for doing. As suggested, re-creating existing solutions of your own effort would teach you, & then you can move on.

Just how I see this topic, & many many others that sing a similar tune.


I apologize if it is unclear, I'm looking to re-create existing solutions of an operating system (by operating system I mean a very small one code wise not a 3 million line windows system or linux). I'd like to learn how all the parts work and fit together and learn so by doing rather than just reading the theory so I can see it actually works.

Thanks
Was This Post Helpful? 0
  • +
  • -

#11 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5224
  • View blog
  • Posts: 26,990
  • Joined: 10-May 07

Re: How to program for Hardware / Operating System?

Posted 24 November 2013 - 10:33 AM

Then I would suggest reading about the processor you want to code for. Find what cpu the raspberry pi uses, & get an interrupt list from the manufacturer. For years you could get these free from Intel.

I'm not that familiar with such things, but from my experience, when I wanted to code a boot loader, I just read the documentation, chose my assembler, & started coding. I'm not sure that you are going to find the tutorials you are looking for. Again, there is a difference between doing it, especially being the pioneer to do it, & just following tutorials of someone else that did it.

In my opinion, you're asking for the wrong data.
Was This Post Helpful? 0
  • +
  • -

#12 newyear498  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 11-December 11

Re: How to program for Hardware / Operating System?

Posted 24 November 2013 - 05:12 PM

View Postno2pencil, on 24 November 2013 - 10:33 AM, said:

Then I would suggest reading about the processor you want to code for. Find what cpu the raspberry pi uses, & get an interrupt list from the manufacturer. For years you could get these free from Intel.

I'm not that familiar with such things, but from my experience, when I wanted to code a boot loader, I just read the documentation, chose my assembler, & started coding. I'm not sure that you are going to find the tutorials you are looking for. Again, there is a difference between doing it, especially being the pioneer to do it, & just following tutorials of someone else that did it.

In my opinion, you're asking for the wrong data.


Awesome thanks, I guess I'm trying to follow too much, guess I'll just have to go for it!
Was This Post Helpful? 1
  • +
  • -

#13 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5464
  • View blog
  • Posts: 11,731
  • Joined: 02-June 10

Re: How to program for Hardware / Operating System?

Posted 24 November 2013 - 05:21 PM

Quote

I am only looking for what I need to know [...]


Mate, its an OPERATING SYSTEM. What you need to know is how to code really, really, well. Strict adherence to OOP concepts for starters. Planning, design, planning, and more planning.

Quote

I'd like to learn how all the parts work and fit together and learn so by doing rather than just reading the theory so I can see it actually works.


Never going to work. Sorry for the blunt truth, but we're hear to help you not blow sunshine and rainbows up your kilt.

You don't jump in a NASCAR at the age of 15 and say "I'm not going to read a book. I'm going to just jump out on the track and floor it and learn by doing." You die that way. You don't buy $50,000 in lumber and start sawing and whacking with a hammer under the intent "I'm not going to read any dry boring books about architecture. I'll learn by doing."

The fact that you think you are going to learn 'just what I need to know' about building any program, let alone an operating system, by just copy/pasting someone else's tutorial is crazy. It really shows that you don't know, just how much you don't know.

I'm at a loss as to why you are fighting so hard against the idea of building a single driver as a starting point to your O.S. education. You know you'll have to build drivers for your simple OS, right?

I'm rapidly agreeing with no2pencil that it sounds like you just want to copy/paste someone else's code from their tutorial and then call it your own work. Because what you're saying you want to do just really makes no sense at all.

This post has been edited by tlhIn`toq: 24 November 2013 - 05:23 PM

Was This Post Helpful? 0
  • +
  • -

#14 newyear498  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 11-December 11

Re: How to program for Hardware / Operating System?

Posted 24 November 2013 - 05:37 PM

View PosttlhIn`toq, on 24 November 2013 - 05:21 PM, said:

Quote

I am only looking for what I need to know [...]


Mate, its an OPERATING SYSTEM. What you need to know is how to code really, really, well. Strict adherence to OOP concepts for starters. Planning, design, planning, and more planning.

Quote

I'd like to learn how all the parts work and fit together and learn so by doing rather than just reading the theory so I can see it actually works.


Never going to work. Sorry for the blunt truth, but we're hear to help you not blow sunshine and rainbows up your kilt.

You don't jump in a NASCAR at the age of 15 and say "I'm not going to read a book. I'm going to just jump out on the track and floor it and learn by doing." You die that way. You don't buy $50,000 in lumber and start sawing and whacking with a hammer under the intent "I'm not going to read any dry boring books about architecture. I'll learn by doing."

The fact that you think you are going to learn 'just what I need to know' about building any program, let alone an operating system, by just copy/pasting someone else's tutorial is crazy. It really shows that you don't know, just how much you don't know.

I'm at a loss as to why you are fighting so hard against the idea of building a single driver as a starting point to your O.S. education. You know you'll have to build drivers for your simple OS, right?

I'm rapidly agreeing with no2pencil that it sounds like you just want to copy/paste someone else's code from their tutorial and then call it your own work. Because what you're saying you want to do just really makes no sense at all.



I'm more than happy to build a driver as a starting point, I just need to know what a good starting point would be for building a driver. What to read etc. :)
Was This Post Helpful? 0
  • +
  • -

#15 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2533
  • View blog
  • Posts: 4,633
  • Joined: 24-September 10

Re: How to program for Hardware / Operating System?

Posted 25 November 2013 - 07:50 AM

A tool you'll need in your arsenal on your path towards learning programming... or learning any complex skill, will be the ability to do research on your own.

We gave you a starting point, build a sound card driver. There's even several references to paradigms and a starting approach to take.

Go out now, research it. In researching you'll find books and articles and other various things to help you.

Don't expect us to do the research, tally it up, and hand it to you.



Last suggestion, read the image in my signature.

And master the art of google-fu.
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2