OK then, What is DOS?

Discussion in 'Software' started by mag00, Feb 26, 2004.

  1. mag00

    mag00 Sergeant

    Hi, I'm new to this board and never really persued the nuts and bolts of computer programming. At one point I did however own a TRS 80. Oh the pain. Since I never really gave it alot of thought, as I just did alot of auto wrenching etc. Still always been facinated by the programming end of computers.

    Now as I get older, it's time to kick in the ole brainpower again, and not sure where to start.

    So the DOS, I would assume is somewhat like the Basic used years ago right?

    How does the dos turn the little 0's and 1's I hear about? Is dos a result of another program language?

    I think I may need to know dos and was wondering the best self learning place or technique, any suggestions clarifications?

    What will be outdated and cast aside first? Dos? Fortran? C++? Something I know not of? I ask so I may focus on something that will be around awhile.

    Also being just converted to dos machines (been a mac guy) do any of the languages work on both platforms?


    Is this too much to ask in one topic?

    Should I be prepared to be overwelmed?
     
  2. Kodo

    Kodo SNATCHSQUATCH

    I would all but pretend that DOS doesn't exist. It's rarely used. I would concern yourself with the more advanced operating systems available for the x86 (IBM compatible i.e. not MAC).

    You have the obvious, Windows2000 / XP /2003
    and the vast distributions of Linux

    Just a little info on DOS. DOS stands for DISK OPERATING SYSTEM. It was a very basic operating system that is ancient! It was not a language in any way.

    Fortran ,believe it or not, is still use today and C++ is a big heavy hitter prime time programming language.

    Where to start depends on where you want to go.
    You have your free operating systems to mess with ,i.e. Linux and you have Windows.

    choose your destiny and we'll be happy to help you. ;)
     
  3. mag00

    mag00 Sergeant

    What is used to write vedeo games?
     
  4. mr_flea

    mr_flea First Sergeant

    Almost anything could do it, but C++ would probably be the easiest.
     
  5. Kodo

    Kodo SNATCHSQUATCH

    as flea said, C++ is the common language of choice to write games and game engines.
     
  6. goldfish

    goldfish Lt. Sushi.DC

    Depends what kind of game though :p. I wrote a simple game in QBasic once, but like i said, it was very very simple. Pong was complex in comparison.
    You could start from the bottom, i.e. Assembler or ASM, which is near as youre going to ever want to get to binary code. its basically the instructions sent to the processor to do things (e.g. add two numbers together, divide two numbers, etc.) and thats about it.
    Going further up youve got things like C (as opposed to c++) which you can include assembler code inline with C code. Pascal is probably down here too
    Then you start getting into c++ and basic, and after that you get into things like VB, Delphi etc.

    If you want to learn the basics of using programming, its good to start in a basic language. It teaches you the logic of programming, although its limited in its use in the real world. QBasic is quite good for this.

    Once you've got the idea of programming theory, you can move on to somthing higher level which you might actually be able to make use of. The main thing in windows programming is API, which is the main thing that modern games use (DirectX or even OpenGL API). Most higher level languages can handle API messages etc.
     
  7. mag00

    mag00 Sergeant

    So what language is dos programed with?

    What language is Mac?

    What will be the new Win OS?

    I'm not really sure what I want to learn at this point, but I can tell you I would most likely be leaning towards a language that will help in troubleshooting, being a mechanic and all. Probably will need to know dos just as I need to know carbueretors, although they are becomming a thing of the past. I have some HTML also, which I will most likely need.
     
  8. goldfish

    goldfish Lt. Sushi.DC

    Dos was programmed with Assembly I *think*
    Mac is in a weird version of C or Assembly i think, for the processors they use (RISC based rather than x86 i think)
    The newest windows OS will be Longhorn, but that wont be out for some time yet, and will be called somthing else when it is released. The most current version of windows is XP.

    You're quite right knowing a few DOS commands will help you even with the latest version of windows (command prompt is based on DOS commands), but it wont get you very far practically.
     
  9. Kodo

    Kodo SNATCHSQUATCH

    actually, the most current version of windows is WindowsServer 2003 ;)
     
  10. iamien

    iamien Cptn "Eh!"


    Kodo said it well.
    A big problem with new programmers these days is that they think that you should start with windows programs. Making applications with nice interfaces and what not is nice. BUT and there is a big but here. You should not learn like that. Learn console first. Console Interfaces are half the Input Output code as a windows program, you will learn how to design a proper program. Once you know that you can apply that to WHATEVER your programmings
    Take this for examples
    At the moment i am designing a program to split up a large file into smaller files to be send over the internet. Simple enough i supose. I want the End Result to have a nice GUI, neat feature and what not. BUt you dont start with that. You build it in layers. You start with the first layer, in this case a simple program to read in a file. You dont want to overhead of creating a GUI, dealing with windows and all that. So you make your interface in Console <dos prompt in windows case> This lets you concentrate on what matters.
    Synopsis: Dos' day are done for actual programs. BUt when you start designing something using a Console <such as DOS> allows you to test and debug a program in an enviorment where you dont have to worry about things like Creating a window, and a million other things windows bogs you down with.
    Also you have Batch tools. Its amazing how a simple batch file can make a programmers life easier.
    Take a simple program for Example. It reads in numbers, add them and prints the result. It will Keep adding until you type in a 0. You have to test this program 20-30 times in the course of its development, which is tedious to type in.
    So you use some nice console operators.
    You can create a text file with the following <lets call it numbers.txt>
    1
    2
    3
    4
    5
    6
    7
    8
    0
    then a batch file < a batch file is just a bunch of console commands that you run, so you dont have to type them all in>
    Tool.bat
    echo off
    cls
    MyProgram.exe > numbers.txt
    echo on

    You can then run this, it will input all those numebrs into the program.

    You can't forget about dos. Only forget about writing software that you wish to release to the public in dos. No one wants to run it unless its something where the extra control allowed by dos is needed, which is rare in a PC enviorment. People like to be able to turn on their computers and have it WORK. Programmers need this extra flexibility when testing it and debugging it. Learn to use the console, and in any language you wish too program in you will have a tool that is very powerful.

    What you should learn. Well thats a matter of person preference. If you want to do Web Programing, look at soem Server Side Scripting. PHP PERL Python are good ones to look into. You want to write programs were you have control over whats happening and you built it the way you want, C or C++ will be good. You want something where the speed isn't critical, and you dont need a lot of control, just quick "easy" development, VB is good.
    A lot of people look down on VB, i think this is because of the fact that VB attracts a lot of young programmers who dont put the time in to learn propper programing style, and can't design a proper program. So the programs end up looking bad and not working right or they are slow. Its not the languages fault, its the people writting it are using something a teacher once descibed to me as Big Bang programming. That would be sitting down at a keyboard and writting you entire applciation. No planning no nothing. You have to figure out the flow of the programm first. Do this by making proper flow chars. You figure out how the program will flow, run sample data threw it and get all the logical errors out of it. That way when you get to writing the actual code, all you have to worry about is Syntax. You master that, you can learn any language you want, all you'll be learning is Syntax. You could take the flow charts i have for all the functions in my File Splitting program, and use them to write it in VB, PHP whatever IT Doesn't matter. what matters is that the logical flow of the program has been tested, so you just translate it.

    Alright i've been long winded enough. If you want to learn to program, i'd suggest a course. You can do it on your own, thats what i did. But now that i am taking courses, i see were i went wrong in doing that. My style was wrong, i was trying to Big Bang it. Which is like building a circuit without a blueprint, it can work, but once that circuit board starts having Multiple capacitors, resistors and other things that make it more complex, you'll loose track of how its working. Which leads to bugs, which lead to anger, which leads to the dark side.

    PS: To Goldfish. Dos was done in C and Assembly. Core things, this Interupts, Streams and other things that are real time and ctirical processes are in assembly. Then you have a layer on C that interacts with it. You can write and OS in pure C or C++, you need the assembler to do things that can't be done with the control you need to do them in a language like c or C++.
     
    Last edited: Feb 27, 2004
  11. mag00

    mag00 Sergeant

    Now that that is all muddy clear, it's like I know both ends but not the middle. Let me explain.

    I have had a few years of electronics, and have basic understanding of how this all works on the electonic end. I also see the result of everything.

    Just exactly how do these compilers/ languages comunicate to the chips? I've had many times in the past tried to understand this and maybe the people teachers couldn't convey the information in a way I could relate. You guys here seem to be pretty good with this stuff.

    Is this performed on a keyboard? But then how did the keyboard know how to talk to the chips/cpu?

    Or has technology taken us past the basics? example how many know how to do trig on paper? Heck, I just whip out the calculator.

    Sorry if this seem trivial, just can't quite connect all my dots :rolleyes:
     
  12. goldfish

    goldfish Lt. Sushi.DC

    Linux was written in C. And i second planning! I made exactly the same mistake when i started learning Delphi, and i began to make silly mistakes a lot, and my programs would develop "spontaneous features" (bugs :p) because i hadnt worked it through properly beforehand.

    With web scripting its easier to code badly, i.e. not planning it at all. Mostly because its so easy! :p But again, you get bugs etc. as you work on it.

    Like Iamien said, VB isnt bad because its slow and bloated, but beacuse people dont use it properly. And the way its made encourages that. Everything you could possibly want in a VB program is a module which you drag over into the form youre working on.

    An example my CS teacher in school made : if you were given an assignment to read a record from a database, if you were to do it in VB you just have to drag across the database object and execute one line of code.. which you would get NO marks for because you didnt show that you knew how to use a database, but simply that you can drag an object from a toolbar! If you were to do the assignment in somthing simple like QBasic (which would take several hundred lines of code, a lot of agro and forcing it to open somthing that ISNT a .txt file, along with several other handy restrictions it has :rolleyes: ) you would LEARN how to read a record from a database.

    Oh yes and console stuff is definatley useful for like he said, debugging, but you also have to think about command line parameters for your programs. Us admins do like a bit of automation :) and if youre programming a game, you might want a /safemode switch which uses default setting so the user can change their settings that the game wouldnt run under otherwise.
     
  13. goldfish

    goldfish Lt. Sushi.DC

    Right, ill try and help you here :

    Everything in a computer is connected to the motherboard. The motherboard contains several chips, BIOS chip, northbridge, southbridge etc. These pass the messages from various different parts of the computer to the processor or memory as appropriate. Each part has I/O on the motherboard for it to communicate with the rest of the system. the OS (which the core will be loaded into memory) will ask for certain things from the motherboard, and it will then give it the resource it needs, e.g. a certain piece of data on a hard drive.

    I'm not awfully hot on the deep down basics of a computer, but to be honest you dont REALLY need to know that unless youre planning on re-programming your BIOS or somthing like that. But if youre interested in programming, you need to know how a language works (as Iamien says)
     
    Last edited: Feb 27, 2004
  14. iamien

    iamien Cptn "Eh!"


    Ok lets start at the bottem
    A computer processor has a language of its own. Its called Assembly and for a PC you likely have <anything you'll buy besides a Mac> its runnign the X86 language. you use the language to tell the processors what to do. A language like c++ is just a way of using this super controlling language in a more managable way.
    in C++ to add a number to another number you do something like
    X += 2; That adds two into X.
    A Compiler turns that into assembly. which would end up being 4 lines of code.
    Imagin it like this. You have an all powerfull language, that can control the processor totaly. Thats a lot of power. And its hard to manage because you have to keep track of every little thing. So you use a language that controls that other language. you Automate a lot of the complex things, so that you dont have to take care of them. In doing this you loose some control, but you gain the ability to write the code and design it a lot easier. thats all a language is, a way of saying a bunch of thing at once, so that you dont have to rememebr as much, and you can be a more efficent coder.
    If you need me to clarify this i can, its a complex subject that can be amazingly interesting.

    Edit: To add. Languages also serve the purpose of being able to make your code be able to run on a Mac, or a Sparc Sunsystem. it doesn't matter where it runs, as long as there a compiler to turn your code into the proper type of assembly. This applies to when you use only the standard of a language. For example. if i wrote something that used Windows to create a window, that code wouldn't work on a MAc because Mac make windows is a different way. Dont worry about this edit, what i feel matters is the rest of what i said, this is just kind of here in case you care :)
     
    Last edited: Feb 27, 2004
  15. mag00

    mag00 Sergeant

    Nice! So I follow ya with a bit more understanding. So back to an automotive analogy. While I know a carb mixes gas and air for a proper combustion, I also studied how that cubustion works on a deeper level. The comprssion of the molecules adds energy and the electrons become more active and unstable and when you ad a spark it explodes etc. don't need to know exactly as I'm not engineering any carbs or fuel injection.

    Knowing the basics of the initial components does however give a good comprehension for possible problems or new developements.

    For me to just learn cookie cutter programming would be totally boring. Much as working the assembly line in Detroit.

    I do as I say have a fair understanding of semiconductors and how they work. It's just how does that get from the fingertips into the circiuts in a manageable way.

    Maybe I missed a key point, and that's OK as long as I can eventually get that.

    Heres where I'm fuzzy, I hear about 0's and 1's in sets of eight. I imagine, but no comprenday, on and off pathways that when switched give the desired outcome. If yes then(1), if no then(0). I quit my electronics study at the computer section as the teacher didn't comprehend english enough to answer my questions coherently and was totally frustrated. I hate when that happens :p ,

    Anyway alot of what I want to know may not be neccessary to program much like knowing how a tree grows and is cut to make lumber, is needed to the guy who builds a house.

    However, the guy who know about wood grain structure and can utilize the natural differences when designing, will ultimately build a better, longerstanding, nicer looking house, where the doors close and open with humidity changes etc.

    And I want to build nice things. May or may not be needed, but seems alot more fun. Who know's, maybe I could develope one Kick Butt compiler or language!!

    BTW I really do enjoy this topic, and would like to thank all for joining in :)
     
  16. iamien

    iamien Cptn "Eh!"

    To be honest i dont know, you never get down to controlling individual on/off states of the processors. Assembly is as close to that as you will ever go <theres one level lower, Operation Codes, but its not a language its just a list of codes to send to processor>
    On my way out, but i'll post some more later
     
  17. GregoryDalton

    GregoryDalton Private E-2

    I think I understand where you are coming from, mag.
    Let me drop my 2 pence in and see if this maybe clarifies things any for you.

    A computer is considered to be built of layers, though most of these are virtual. The lowest layer/level is the physical machinery... the actual components... your memory, your processor, hard drive etc. And at this level the only things the computer really understands are on/off states, represented in Binary with 0s and 1s. Or Electrical Impulses across a board. This ('in a nutshell') is the fundamentals of a computer. Its important to understand that your memory is stored as 0s and 1s, and that your processor processes by doing very basic things 0s and 1s. It is only because the CPU can do this stuff so fast that it kinda amounts to the wonderous 3D graphics of the latest games. Now computer architecture is a very complicated subject. We deal with various levels of caching, components that do things the average and even advanced user will have no idea of. It is not the average 'application' developers job to worry about this.

    You see, several layers above the physical stuff we have the Operating System, or OS. The OS is designed to act as an interface between the user and the hardware. It worries about the hardware so we dont have to. And there is a reason why the OS market is dominated by a few big names... because they are complicated programs. An OS has numerous drivers in there. The drivers are provided by the vendors of hardware and they tell the OS how to manipulate the hardware. Ok - this is true at a generic level, but some of the other handling is done through standards and the mother board, but I dont want to get too messy here.

    Then we have an application layer. When you load an appliation, like MS Word, or a game, or whatever, your OS looks up where this data is stored physically on your hard drive. The lower levels of this stack worry about spinning the hard drive, controlling the reading head to get those 1s and 0s off... fed into your memory, and then the processor does its registry manipulations/address manipulations/adding/subtracting etc... At the OS level this program is brought into life and tracked and presented to you.

    You dont need to worry about this aspect, but as a programmer you kinda need to understand that it is happening to a certain degree...

    To answer your earlier question, DOS is an OS. When you are looking at C++ books they will tell you to write simple DOS apps. You will start off no doubt, as most programmers do, with the "Hello World" application. In C++ this is a few lines long.
    The C++ compiler will convert those few lines into hundreds and hundreds (possibly thousands) of lines of assembly code which tell your OS how to tell your hardware how to do this stuff... The net result is a program that displays "Hello World" onto the screen. Marvellous.
    DOS, or Terminal/Console based applications are a good place to start. You can learn the fundamentals of programming, such as loops and if statements without things getting too messy.

    Now let me see if I can get this next point across...
    But programming, like computers, are now considered to be multi-layered. Or more specifically the different programming languages are relevant at different levels.
    Take assembly. You are literally telling the hardware what to do. The commands you write which form your program tell the hardware what to do in specific terms. But this is an incredibly complicated way of programming. The mnemonics (spealling?) used in Assembler are directly translatable usually to hex (which can be viewed as a short hand representation of binary).
    It is much more common to program using a higher up language - a 3GL (Third Generation Language) or higher. Now this is A'Level stuff from the good ol' days so a little rusty - but languages like C++ are considered to be 3GL+. Its kinda like you are programming at a different level of abstraction. You dont need to worry about the hard disk spinning or the processor crunching. You write the core functionality of your program. The 3GL code actually gets compiled into the low level assembly based instructions anyway... If you ever see those they wont mean a great deal of sense.

    I think this is key to your understanding Mag - levels of abstraction of the overall system. Consider your previous analogies. Instead of being a basic worker very good at what you do to do with combustion engines or carbarettas or whatever, you have a knowledge of these 'building blocks' and you are the boss that decides what order these things are done... how they are cobbled together, and what the end result is. Yes the basic worker down there has to have an incredibly intrinsic knowledge of what happens with his process... because htat is his job... you however know what goes in and what goes out. The how is not so important.

    Does this make any sense?

    To summarise...
    The OS is a platform you write your applications on. The hardware is a platform your OS drives.
    DOS is an example of a platform. I think someone mentioned how it was written though I arent incredibly sure. Windows/Linux (or any other UNIX based OS) are all OS's. There are loads. You need to decide what platform you wish to write programs on.
    If they are games I would probably think Windows. Once you ahve your hands on the basics of programming in say C++ and understand component based OO, then you will find a whole wealth of tools on the net to help you learn how to program... But that is later...

    Does that help any?
    Cheers,
    Greg
     
    1 person likes this.
  18. Kodo

    Kodo SNATCHSQUATCH

    I would just like to add that VB.NET is not like VB6. It's more strict.
     
  19. iamien

    iamien Cptn "Eh!"


    That my friend, is a thing of sheer beauty. A wonderful explanation, i wish i could create a picture like that.
    Nice explanation, thats all i can say. :)
     
  20. GregoryDalton

    GregoryDalton Private E-2

    :) Cheers man
     
  21. mag00

    mag00 Sergeant

    :D Sorry, I had been away from the puter a little bit. Seems my friends only remember me as the mechanic/construction guy who does fabulous work. I keep telling them I don't do that any more, but it sure is hard to turn down the puppy dog eyes. Seriously, I see no future in const/mech fields.

    Thanks for the in depth description, I may have to read that a couple of time to assimilate it. I was at one of those Crown book discount selling warehouses and ran accross a pile of comp books. I had no idear what to get so I settled for a windows 98, and frontpage 98 doorstop (book). They had the v basic and c and maybe even some c++, just not real sure what I need to focus on yet. I guess I'll start from the user end and work backwards.

    As mentioned, I may not have to learn the exact physics of the computer, to accomplish the end result. It's like an old guy I apprenticed with for TV repair, he knew nothing about electrons or semiconductors etc, but he sure could fix a TV. I on the other hand like to tear things apart and understand what makes it tick.

    BTW What do you call a deer without eyes?------No eye deer?

    What do you call a deer without eyes or legs?
    Still no eye deer?

    What do you call a deer without eyes or legs or sex organs?
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds