MS-DOS 1.00 Date information retrieval

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

MS-DOS 1.00 Date information retrieval

Post by VolTeK »

Im not too sure how MS-DOS 1.00 got the time from the system, going through Ctyme's interrupt list for 0x1A i see a way to get the date, but its for machines above IBM 5150 (XT286 for example). Does anyone know how DOS got the system time?


I want to be able to get the date, but not have to have requirements for machines above the IBM 5150. Any specs/examples/links to information on this?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: MS-DOS 1.00 Date information retrieval

Post by Brendan »

Hi,
VolTeK wrote:Im not too sure how MS-DOS 1.00 got the time from the system, going through Ctyme's interrupt list for 0x1A i see a way to get the date, but its for machines above IBM 5150 (XT286 for example). Does anyone know how DOS got the system time?
On extremely old computers (that had no RTC or "get time/date" BIOS functions), DOS asked the user during boot.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: MS-DOS 1.00 Date information retrieval

Post by VolTeK »

Brendan wrote:On extremely old computers (that had no RTC or "get time/date" BIOS functions), DOS asked the user during boot.
Thank you, the only type of info i can get is the time, as for the date i had figured the same.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: MS-DOS 1.00 Date information retrieval

Post by qw »

Iirc, all versions of DOS up to 7 prompted the user for the time and date if AUTOEXEC.BAT was not present.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: MS-DOS 1.00 Date information retrieval

Post by VolTeK »

Hobbes wrote:Iirc, all versions of DOS up to 7 prompted the user for the time and date if AUTOEXEC.BAT was not present.
A fun fact i suppose?....
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: MS-DOS 1.00 Date information retrieval

Post by Casm »

VolTeK wrote:Im not too sure how MS-DOS 1.00 got the time from the system, going through Ctyme's interrupt list for 0x1A i see a way to get the date, but its for machines above IBM 5150 (XT286 for example). Does anyone know how DOS got the system time?


I want to be able to get the date, but not have to have requirements for machines above the IBM 5150. Any specs/examples/links to information on this?
It's a good job I have a long memory. Try int 21h, function ah = 2ch

Interrupt 8 maintained a dword count at 40:6ch (18.2 ticks per second, starting at midnight).
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: MS-DOS 1.00 Date information retrieval

Post by VolTeK »

Casm wrote:It's a good job I have a long memory. Try int 21h, function ah = 2ch
Its alright, i've already written my version of IO.SYS now, moving on into MSDOS.SYS.



I will also state im rewriting my own version of MS-DOS not running it on top of. It then would just be an application.

Not looking for the time either. The System provides it -.-
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: MS-DOS 1.00 Date information retrieval

Post by qw »

VolTeK wrote:A fun fact i suppose?....
Indeed, and an answer to your question.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: MS-DOS 1.00 Date information retrieval

Post by bubach »

I'm not so sure about that. What possible connection does autoexec.bat has with time & date? Only thing I can think of was on very old computers without battery powered clock where it could contain the "TIME" and "DATE" commands to ask the user at each boot, but that was _with_ an autoexec.bat - not without one.
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: MS-DOS 1.00 Date information retrieval

Post by iansjack »

As I remember it the default for a 5150 running MS-DOS 1 was to prompt for time and date. This was the default because it didn't have an RTC. But if you added an RTC on an add-in card then you would put a command in autoexec.bat to set the time and date from the card and not prompt for them. Early versions of DOS insisted on a valid date; in later versions you could just press <Enter> and get the default 01-01-1970.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: MS-DOS 1.00 Date information retrieval

Post by Love4Boobies »

Casm wrote:
VolTeK wrote:Im not too sure how MS-DOS 1.00 got the time from the system, going through Ctyme's interrupt list for 0x1A i see a way to get the date, but its for machines above IBM 5150 (XT286 for example). Does anyone know how DOS got the system time?


I want to be able to get the date, but not have to have requirements for machines above the IBM 5150. Any specs/examples/links to information on this?
It's a good job I have a long memory. Try int 21h, function ah = 2ch

Interrupt 8 maintained a dword count at 40:6ch (18.2 ticks per second, starting at midnight).
It's a bad job you can't read, though. The question was how DOS got the time, not how the programmer could get it from DOS.
Hobbes wrote:Iirc, all versions of DOS up to 7 prompted the user for the time and date if AUTOEXEC.BAT was not present.
Nope.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: MS-DOS 1.00 Date information retrieval

Post by qw »

Perhaps it was CONFIG.SYS, I am not sure.

What possible connection AUTOEXEC.BAT (or CONFIG.SYS) could have with time and date I don't know. You should ask Microsoft.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: MS-DOS 1.00 Date information retrieval

Post by VolTeK »

Hobbes wrote:Indeed, and an answer to your question.

I ask how MS-DOS Gets the date (the current time is) and then asks for input, not when it does or doesn't if or if not AUTOEXEC.BAT is present on the disk.

Hobbes wrote:Perhaps it was CONFIG.SYS, I am not sure.

What possible connection AUTOEXEC.BAT (or CONFIG.SYS) could have with time and date I don't know. You should ask Microsoft.
You are correct about your statement however, adding an (even empty) AUTOEXEC.BAT to (what i have to be MS-DOS 3.3) it skips asking the time and date.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: MS-DOS 1.00 Date information retrieval

Post by bubach »

VolTeK wrote:You are correct about your statement however, adding an (even empty) AUTOEXEC.BAT to (what i have to be MS-DOS 3.3) it skips asking the time and date.
Yeah, thats because what I said about the time and date commands in autoexec.bat was true. He said it the other way around, that an empty or non-existent autoexec.bat WOULD make it ask.... :roll:
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: MS-DOS 1.00 Date information retrieval

Post by VolTeK »

bubach wrote:Yeah, thats because what I said about the time and date commands in autoexec.bat was true. He said it the other way around, that an empty or non-existent autoexec.bat WOULD make it ask....
That's cool, but whether it asks or not has nothing to do with my original question. I ask how it gets the date, not, when should it ask for the time or date.

Don't skip ahead and read the title, who knows, you may have to read one more line of words to recognize what the question is.
Post Reply