Dos Is Still Alive

netfreak

Regulars
[OP]
Regulars
Sep 8, 2005
2,160
14
http://www.pikecountycomputer.com/gnudos/index.html

Some perople are still using (AND developing) DOS.

I thought nobody would be using DOS in this age.
 

max

Regulars
Regulars
Oct 6, 2005
2,780
6
DOS is the fastest PC OS? :eek:
 


popcorn

Senior Member
Apr 10, 2005
3,105
74
Mumbai
dos 4 and earlier were 8 bitdos 5,6,7 are 16 bitwindows 3.1 was 16 bit and virtual 32 bit.win95 was virtual 32 bitwin98 to xp was 32 bitwinxp64 is 64 bitso obviously dos is slower than windows 32 bit.you can see the diff in copying a huge file in dos and in windows 32
 

netfreak

Regulars
[OP]
Regulars
Sep 8, 2005
2,160
14
QUOTE(sifyfan @ May 13 2006, 02:51 PM) [snapback]51154[/snapback]
so obviously dos is slower than windows 32 bit.

you can see the diff in copying a huge file in dos and in windows 32
[/b]

1. What makes a 16 bit system slower then 32 bit system? 16 bit system might not be able to access as much memory as 32 bit system, but how will they be slower/faster?

2. File copy speed should be restricted by Hard disk read/write speed, rather then OS speed. Since data transfer happens over DMA (without any kind of involvement from CPU).

In fact, "some" programs will run fater in DOS (e.g. SuperPI). Since all they need to do is crunch numbers and display output. In Linux/Windows, something as simple as writing a pixel to screen or allocating a block of memory takes thousands of instructions to execute. These operations are done by kernel in Linux/Windows for a good reason, but it involves a context switch and thats a costly operation.

In DOS, its just:

Code:
void main(void){   unsigned char far *screen;          // pointer to the VGA video memory   int screen_width, screen_height,x,y,colour;   screen=MK_FP(0xa000, 0);          //  Assume screen is in 13 h mode   screen_width=320;     // Actual line of code...   *(screen + y*screen_width + x)=colour;}
And thats just a few ASM instructions...
Code:
  ;      ;    {  ;       unsigned char far *screen;          // pointer to the VGA video memory  ;       int screen_width, screen_height,x,y,colour;  ;       screen=MK_FP(0xa000, 0);          //  Assume screen is in 13 h mode  ;        mov    word ptr [bp-2],40960    mov    word ptr [bp-4],0  ;      ;       screen_width=320;  ;        mov    word ptr [bp-6],320  ;      ;         // Actual line of code...  ;       *(screen + y*screen_width + x)=colour;  ;        mov    ax,word ptr [bp-10]    imul    word ptr [bp-6]    les    bx,dword ptr [bp-4]    add    bx,ax    add    bx,word ptr [bp-8]    mov    al,byte ptr [bp-12]    mov    byte ptr es:[bx],al  ;      ;    }  ;    


I know its a long post.. but DOS programming has a Nostalgic effect.
 


max

Regulars
Regulars
Oct 6, 2005
2,780
6
QUOTE(netfreak @ May 14 2006, 02:31 AM) [snapback]51204[/snapback]
1. What makes a 16 bit system slower then 32 bit system? 16 bit system might not be able to access as much memory as 32 bit system, but how will they be slower/faster?

2. File copy speed should be restricted by Hard disk read/write speed, rather then OS speed. Since data transfer happens over DMA (without any kind of involvement from CPU). [/b]
AFAIK, the OS must have the DMA drivers to actually drive the DMA controllers otherwise it will be plain old transfer using the CPU. Also, 16-bit OS means not only lesser address space but also lesser data transferred per clock cycle
 

netfreak

Regulars
[OP]
Regulars
Sep 8, 2005
2,160
14
QUOTE(max @ May 14 2006, 01:41 PM) [snapback]51240[/snapback]
AFAIK, the OS must have the DMA drivers to actually drive the DMA controllers otherwise it will be plain old transfer using the CPU.
[/b]

In MS DOS things work a bit different for floppy and IDS drives. Disk access is done by BIOS. And you can enable / disable DMA in BIOS. All a program needs to do is raise INT 13h.

13H is a software interrupt. In IBM comatible PCs, this vector always lands in BIOS code. BIOS can dransfer data with programmed I/O or DMA. Default is DMA, but you can choose to disable that through BIOS.

This inerrupt supports floppy and HDD only, device number goes into a1 dl- drive (0..7fh is floppy 80h..ffh is hard disk)

CD Drives are not directly supported by BIOS and there you need driver support.


QUOTE(max @ May 14 2006, 01:41 PM) [snapback]51240[/snapback]
Also, 16-bit OS means not only lesser address space but also lesser data transferred per clock cycle
 

max

Regulars
Regulars
Oct 6, 2005
2,780
6
QUOTE(netfreak @ May 14 2006, 02:45 PM) [snapback]51247[/snapback]
If you step into 13h, you can see examples of 32 bit requests being generated for hdd reads and writes.[/b]
I dont like seeing ASM code...And I guess there is no way to see the C code. BTW I am interested in seeing all this. I already have a VM installed at my place ( QEMU ). I may install DOS 6.22. Care to give me some instructions?
 

netfreak

Regulars
[OP]
Regulars
Sep 8, 2005
2,160
14
Download ISO from :

http://freedos.sourceforge.net/freedos/files/

And boot your VM with fdbootcd.iso

Once you hare in DOS,

1. run debug command
2. have a look at 13h vector (note value stored at 13h)
3. dump memory at locatio nthat sstored at 13h
4. diassemble (unassemble) the dump

You will see BIOS code there.

Exact code will depend on the BIOS emulated by VM.