flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > MiniDOS - minimalistic DOS clone [DONE]

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
asiekierka



Joined: 17 Feb 2008
Posts: 3
asiekierka 18 Feb 2008, 14:18
I can help you with working in it. I planned to implement Get Date and Set Date, but i have no idea how to "mul AX, 100" so it'll be faster on a 386. If you'll help me with it, i think i'll be able to do it.

EDIT: Seems i will try Get Time and Set Time too.
Post 18 Feb 2008, 14:18
View user's profile Send private message MSN Messenger Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 18 Feb 2008, 14:40
Cool, the functions for time and date are in "FBrowser" code they just need adding to MiniDos.
See here: http://board.flatassembler.net/topic.php?t=8281
Post 18 Feb 2008, 14:40
View user's profile Send private message Reply with quote
asiekierka



Joined: 17 Feb 2008
Posts: 3
asiekierka 18 Feb 2008, 15:17
Sad, i actually wrote the time code form scratch, only my friend wrote the get_BCD code.

Code:
        cmp   ah,2Ch                       ; Does AH = 0x2C
        je    int21_2C                     ; Get time (BIOS procedures)
        cmp   ah,2Dh                       ; Does AH = 0x2D
        je    int21_2D                     ; Set time (BIOS procedures) 
    


Code:
get_BCD:
        mov bl, al
        and bl, 0x0f
        shr al, 4
        mov bh, 10
        mul bh
        add al, bl
ret

int21_2C:
; get time T_T
push bx
mov ah,2
int 1Ah
add ch, dl
xor dl,dl
mov al,ch
jmp get_BCD
mov ch,al
mov al,cl
jmp get_BCD
mov cl,al
mov al,dh
jmp get_BCD
mov dh,al
xor al,al
pop bx
jmp int21_exit

int21_2D:
; set time
      xor dl,dl
      xor al,al
      mov AH,3
      int 1Ah
      jmp int21_exit                     
    
Post 18 Feb 2008, 15:17
View user's profile Send private message MSN Messenger Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 18 Feb 2008, 23:10
Thanks, but i already have the time/date code.


Last edited by Dex4u on 05 May 2008, 03:01; edited 1 time in total
Post 18 Feb 2008, 23:10
View user's profile Send private message Reply with quote
penang



Joined: 01 Oct 2004
Posts: 59
penang 04 May 2008, 14:56
[quote="vid"][url]http://decard.net/article.php[/url]

gets you a little bit further ;)[/quote]


For late comers, the above isn't working anymore.
Post 04 May 2008, 14:56
View user's profile Send private message Reply with quote
Goplat



Joined: 15 Sep 2006
Posts: 181
Goplat 04 May 2008, 18:35
A shorter way to convert a BCD byte into a number:
Code:
        aam 16
      aad    
Post 04 May 2008, 18:35
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 04 May 2008, 22:19
Well, I think that readers figured out that those "jmp get_BCD" in fact should be "call get_BCD".

---Most readers won't learn anything new from the text below---

Since Goplat suggested a much more shorter BCD unpacker I'll add for the record the pseudo-code of those BCD instructions to show why only those instructions are equivalent to the whole get_BCD "function".

Code:
; AAM - ASCII Adjust AX Before Multiply
tempAL <- AL;
AH <- tempAL / imm8; (* imm8 is set to 0AH for the AAM mnemonic *)
AL <- tempAL MOD imm8;

; AAD - ASCII Adjust AX Before Division
tempAL <- AL;
tempAH <- AH;
AL <- (tempAL + (tempAH * imm8)) AND FFH; (* imm8 is set to 0AH for the AAD mnemonic.*)
AH <- 0;    


So, "aam 16" splits AL's nibbles into AH:AL, then with "aad" AH is multiplied by 10 and added to AL which is exactly what get_BCD stores in AL just before returning.

If I made a mistake in the explanation or wasn't clear enough please correct.
Post 04 May 2008, 22:19
View user's profile Send private message Reply with quote
Synaps3



Joined: 06 Jul 2011
Posts: 6
Synaps3 29 Mar 2012, 04:20
I know that this topic is old, but I had two questions about this.

I tested a few < 64K exes on minidos and only one worked. Despite my lack of skills with assembly, I was thinking about adding some more functions to this. The problem is that I don't know which functions I need to implement in order for certain programs to work. Is there a DOS program that will scan another DOS program and report which ints it uses?

Would adding support for exes > 64K be hard, or is it something that would only require a few lines to tweak?
Post 29 Mar 2012, 04:20
View user's profile Send private message Reply with quote
Stephen



Joined: 13 Aug 2011
Posts: 30
Stephen 29 Mar 2012, 15:11
you can run the exe through a disassembler. that will turn the exe into an assembly language source code file. You can then load that file into a text editor and do a search for 'int'. that will very likely give you all the system calls, unless they direct called some things or it's self modifying code....
Post 29 Mar 2012, 15:11
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 31 Mar 2012, 00:02
Its a long time since i worked on miniDos, but i think you can load a exe bigger than 64k, i even have a fasm port for it some where.
If not, it would be easy to add.

There was a TSR called Dostap you could get from here: http://www.smxrtos.com/rtos/dos/undwinpb.htm

Not sure if its still available, but Stephen's way will work OK, it should be simple to code a TSR DOS app, to log function numbers used by a program.
Post 31 Mar 2012, 00:02
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach 20 Apr 2012, 14:36
Why not try modifying the code to print "int 21h called with arguments, ah=xx, al=xx" on any empty functions? It could then force the program to exit and you would know what functions needs work for it to start.

I might try adding to it in the near future depending on how much time I'll spend on my own OS.
Post 20 Apr 2012, 14:36
View user's profile Send private message Reply with quote
bamboo202



Joined: 01 Apr 2016
Posts: 1
bamboo202 01 Apr 2016, 14:21
The link went down
Post 01 Apr 2016, 14:21
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 01 Apr 2016, 14:27
Which link? There are quite a few scattered inside this topic.
Post 01 Apr 2016, 14:27
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 02 Apr 2016, 16:08
Hi bamboo202,
If your talking about the minidos code, here it is


Description: MiniDos
Download
Filename: MiniDOS.zip
Filesize: 74.12 KB
Downloaded: 933 Time(s)

Post 02 Apr 2016, 16:08
View user's profile Send private message Reply with quote
ford



Joined: 21 Jan 2010
Posts: 118
Location: Absurdistan
ford 04 Apr 2016, 13:46
@Dex4u, I have used your MiniDOS as learning material for some time now, and I always end up using it to help others learn. Thank you very much for your hard work!
Post 04 Apr 2016, 13:46
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.