win32 and DOS
|
|||
|
Rank: ? (37)
Member #: 26960 |
Question 1 : What is the difference between coding for win32 system and DOS? I know win32 has a protected mode and deny some assess to things. But what difference does it make?
Question 2 : If assembly is so close to machine language, if a person is really really advance in assembly, is it possible to make his own operating system? |
||
|
|||
|
|||
|
Rank: ? (45)
Member #: 26901 |
In real address mode only 1MB of memory can be addressed and it runs a segmented memory scheme where all of the memory is divided into 64 kb segments. Only one program can run at a time in real address mode but can process interrupts from peripheals. DOS programming in assembly is still used some, but not much.
Protected mode programming run more than one program with each process assigned a 4GB memory space. Windows and Linux both run under Protected mode. Programs are prevented from accessing each others memory. There are other differences between Protected mode and real address such as the sizes of registers used and the sizes of addresses. It is possible for a very experienced assembly programmer to write an operating system, but not an easy task as two compatible computers are required, one to write the OS and another for a test bed. Most Os's are written with a combination of assembly and C or C++. I don't know much about writing an OS, but have heard it can be one of the most frustrating things to program as there is no debugging support and errors can be extremely hard to find. |
||
|
|||
|
|||
|
Rank: ? (37)
Member #: 26960 |
Why does DOS has a 1MB limit and win32 has a 4GB? Are they the limit of the processor hardware or the limit of the operating system allows? So, if the limit is of the operating system, then is it true that a new assembled operation system is not restricted to the memory limit.
|
||
|
|||
|
This post has been removed by the author
|
|||
|
|||
|
|||
|
Rank: ? (45)
Member #: 26901 |
The memory limits mentioned are for the 80x86 processors and are dependant on the sizes of the registers. Beginning with the 386 processor up through the pentiums 32 bit registers were used these can have values up to 2^32-1, thus the 4GB memory space. Prior to to the 386 the 8086 used 16 bit registers. I don't know much about other processor designs.
A good resource for information on this is Intels website where you can download manuals for the processors. |
||
|
|||
|
|||
|
Rank: ? (37)
Member #: 26960 |
This is a question that do not have much to do with assembly but it does involve win32 and DOS.
When I turn on windows XP, why does the screen turn to DOS first? Also, when the window logo comes up after that, is that in DOS or win32? (Thanks MaynardG!!) |
||
|
|||
|
|||
|
Rank: ? (45)
Member #: 26901 |
My knowledge of OS's is rather limited and there are probably others here that can answer your question more completely than I can, but I'll give it a shot. DOS has nothing to do with XP or many of the later versions of Windows, they can, however emulate DOS which is why you can open a command window that looks like a DOS window. Earlier versions of Windows were shells that ran over the top of DOS which was the actual operating system.
What you are probably speaking of when XP Boots is the BIOS which stands for basic input output system. This is a program installed on chips by manufacturers that is specific to different computers. BIOS communicates directly with the hardware and works in conjunction with the operating system. |
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
When I turn on windows XP, why does the screen turn to DOS first?
it's not dos, just because it's white text on a black screen. with xp you're probably only seeing the video card info and the bios stuff before it starts to look like windows to you.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (37)
Member #: 26960 |
So if a computer does not start system from DOS then how does the processor know which codes to start executing in order to start an OS or something? Like which program begin putting codes into the processor? Does that have anything to do with registers? Or does an processor always begin by executing a specific code or the same program?
I am working on a program that emulates a system in a <Megaman> cartoon series called <PErsonal Terminal>. I am wishing to use similar methods on it when the system is starting up, whatever it is. I know it is a bit farfetched trying to do something like this when I am a beginner, but I am going to try anyway. I don't know how a processors starts, but I think I will begin mine by reading a .ini file. What do you think? |
||
|
|||
|
|||
|
Rank: ? (45)
Member #: 26901 |
I am not sure what you are asking, but if you are thinking about tinkering with XP's startup I would definitely recommend against this or you will end up with a broken computer.
|
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
i think he's trying to figure out how to boot his own operating system once he writes it in assembly.
boucly, you might want to look in the operating systems forum for more discussions on writing your own os.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (37)
Member #: 26960 |
Oh! I guess didn't express myself clearer enough. Sorry. I meant to say I am making a program that does what Command Prompt does, only it does not emulates DOS but an operative system more like windows. I know I won't be good enough to program a real operating system unless I study assembly for another twenty years or so. So, I was hoping to make an emulation of it to see what things I might need in it. That will be my initial design. I believe I will never finish it but it's kind of my dream to make it.
What I wanted to know is how does a computer know what programs to run when it was turned on. I am 100% sure that it doesn't run any random program. Should I ask in the operation system forum instead? |
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
what i remember from the digital courses i had a few years ago tells me that booting ends up reading and executing the instruction at a specific address.
what i know from setting up windows and linux tells me that there's a thing called a master boot record (MBR) which is part of the first hard disk, and tells the computer what it should do at boot. you might find more help in the os forum, but i don't check that one so don't really know what it's like.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (37)
Member #: 26960 |
Hmmm... I saw that too when I was reformating Window 95. Kind of confusing then.
You know how we must include windows.inc to write win32 executables. Why don't I need a win32.lib or something to go with it? Because they usually comes in a pair don't they? Also, is it true that a win32 cannot be ran in DOS? Why is that? Is it something special in Windows or in the executables? » Post edited 2006-04-29, 09:01am by Boucly.
|
||
|
|||
|
|||
|
Rank: ? (45)
Member #: 26901 |
The include files needed are dependant on which assembler you are using and also what windows functions your program requires. The Win32API is a library containing procedures and functions for 32 bit Windows programs, DOS uses 16 bit registers.
For a good source of info on this, Google Iczelions Tutorials. |
||
|
|||
|
|||
|
Rank: ? (37)
Member #: 26960 |
Thanks. I think it is included in the MASM32 package but the package only has part of the tutorial though.
Iczelion's Tutorials Thoght this might be useful for any newbie, like me, who might be reading this. |
||
|
|||
|
|||
|
Rank: ? (119)
Member #: 28292 |
In addition to that. The protected mode realizes the running of the programms in different virtual address areas so that they can't contact each other. In protected mode the multi threaded programming could be realized. In protected mode no interruption could be called.
» Post edited 2006-08-26, 06:24am by igorok.
|
||
|
Please login or register to post a reply.