System Date and Other function in PM

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.
Post Reply
adved

System Date and Other function in PM

Post by adved »

hi!!

I am in protected mode now.

I want to show the bios date and time in the console screen. How should I go about that? I even want to update the bios date and time with the one given from the user, like what we have in dos.
Moreover I want to show the amount of RAM in the system.

I can see the interrupt numbers for each services but i am stuck because these interrupts cannot be called in PM.

Hope you'll help me in this

Regards,
adved
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:System Date and Other function in PM

Post by distantvoices »

I have two advices for you at hands, laddie/lassie:

1. stfw - there is plenty of information outta there.
2. as some other members here have stated:
the quicklinkz-section, a sticky link in this forum,
reveals some secrets of interest for you.

to achieve advice further than this, please be so kind and indicate what you are doing to reach your goal.

Hint: in protected mode, you have to write your interrupt handlers by yourself. Go to www.osdever.net for some good texts about this issue.

stay safe and do your homework ];->.

ps: You have to go throu' this yourself for gaining full understanding about what's going on in your cute black box.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:System Date and Other function in PM

Post by Pype.Clicker »

basically, you'll have to do the BIOS's job and check out the realtime clock value (stored in the CMOS, and accessed through I/O ports 0x70-0x74, iirc)

Displaying them on screen will be easy as soon as you'll know that your video memory is located at 0xB8000 and that it has 2 bytes per character (the first one being the ASCII character to be displayed, while the second encodes the 'attributes' as fg_color+bg_color*16)

As for reading new date & time by user input, it's a bit more difficult if you try to do it by parsing

Code: Select all

user:> date
Enter new date (dd/mm/yyyy)
12.03.05
Please check your format (dd/mm/yyyy)
12/03/2005
Date changed to March 12th 2005 AD.
but, you could more easily edit it as if you was a watch: show the user a "current field" and have the date edited by pressing "up" and "down" arrows, changing field with "left" and "right" arrows.

In order to display the available amount of memory, just ask BIOS for the amount of memory before you entered PMODE.
Post Reply