Jump to content











Photo
- - - - -

Latest grub4dos has updating date&time

grub4dos

  • Please log in to reply
25 replies to this topic

#1 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 August 2019 - 09:07 AM

*
POPULAR

Todays new version allows you to display the date and time on the menu and it will update every second.

 

it uses the setmenu --string command  with the special string of "date&time".

 

 

You can check that the version of grub4dos supports it using this line.

help setmenu > (md)0x300+9 ;; cat --locate=date&time (md)0x300+9 > nul && setmenu --string=75=0=0xffffff="date&time"

I have requested some more functionality so you can choose the date and time format using yy-mm-dd and hh:mm:ss.

Attached Thumbnails

  • date&time.JPG

  • wimb, Tokener and alacran like this

#2 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 01 August 2019 - 09:57 PM

How does it retrieve the time? By querying the BIOS/firmware? Is there a standard API that is used? I'm guessing this applies to Easy2Boot specifically, and GRUB4DOS generally.

#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 August 2019 - 09:07 AM

Meet the RTC:

https://en.wikipedia...Real-time_clock

https://en.wikipedia...iki/System_time

 

It is not part of the BIOS or Firmware it is a dedicated chip (battery powered) that interfaces with them (usually via BIOS interrupt 1Ah):

http://www.lpjjl.net.../docasm/RTC.txt

https://en.wikipedia..._interrupt_call

 

:duff:

Wonko



#4 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 02 August 2019 - 10:20 AM

Nothing to do with Easy2Boot, it is a new function of grub4dos.

I think grub4dos calls the BIOS  Int 1ah API to get the time http://stanislavs.or...c/int_1a-2.html

[Edit]


Edited by steve6375, 02 August 2019 - 12:56 PM.


#5 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 August 2019 - 12:11 PM

Nothing to do with Easy2Boot, it is a new function of grub4dos.

I think grub4dos calls the BIOS  Int 13h API to get the time http://stanislavs.or...c/int_1a-2.html

No. Int 13h is disk services, Int 1Ah (which is what you linked, BTW) is time services:

https://en.wikipedia...Interrupt_table

 

:duff:

Wonko



#6 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 02 August 2019 - 02:24 PM

@steve6375

 

Todays new version allows you to display the date and time on the menu and it will update every second.

 

it uses the setmenu --string command  with the special string of "date&time".

 

 

You can check that the version of grub4dos supports it using this line.

help setmenu > (md)0x300+9 ;; cat --locate=date&time (md)0x300+9 > nul && setmenu --string=75=0=0xffffff="date&time"

I have requested some more functionality so you can choose the date and time format using yy-mm-dd and hh:mm:ss.

 

Since grub4dos-0.4.6a-2019-07-16 has some bugs I'm using grub4dos-0.4.6a-2019-06-17.

 

1 - Then can I assume you have tested deeply this new release and haven't found bugs on it?

 

2 - Please give me some example to use this new feature, or What I need to modify/add on my menu.lst

 

it uses the setmenu --string command  with the special string of "date&time".

 

Thanks in advance

 

alacran



#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 August 2019 - 02:49 PM

@alacran

#1 If deeply means "extensively", how can he have tested it in one day? :dubbio:

#2 what about trying the posted:



setmenu --string=75=0=0xffffff="date&time"

:dubbio:

 

Reference (though not exactly easy to understand):

 

https://www.rmprepus...commands-primer

 

 

New 0.4.6a 2018-08 commands (setmenu, beep)

setmenu - controls placing and appearence of menu. keyhelp is the grub4dos edit prompts, entryhelp is the help text used in titles (after title xxxx\n<entryhelp>)

setmenu:setmenu --parameter | --parameter | ... --ver-on* --ver-off --lang=en* --lang=zh --u

--left-align* --right-align --middle-align

--auto-num-off* --auto-num-all-on --auto-num-on --triangle-on* --triangle-off

--highlight-short* --highlight-full

--font-spacing=FONT:LINE. default 0

--string=[X]=[-]Y=COLOR="STRING" max 16 commands.

Note: there is no X, position in the middle.

Note: -Y represents the count from the bottom.

--string= to delete all strings.

--box x=X y=Y w=W h=H l=L

Note: W=0 in the middle. L=0 no display border

--help=X=W=Y

Note: X=0* menu start and width. X<>0 and W=0 Entire display width minus 2x.

--keyhelp=Y_OFFSET=COLOR

Note: Y_OFFSET=0* entryhelp and keyhelp in the same area,entryhelp cover keyhelp.

Y_OFFSET!=0 keyhelp to entryhelp line offset.two coexist.

Y_OFFSET<=4, entryhelp display line number.

COLOR=0* default 'color helptext'.

--timeout=X=Y=COLOR

Note: X=Y=0* located at the end of the selected item.

Note: COLOR=0* default 'color highlight'.

* indicates default. Use 0xRRGGBB to represent colors.

setmenu --graphic-entry=type=row=list=wide=high=row_space START_FILE

type: bit0:highlight bit1:flip bit2:box bit7:transparent background

naming rules for START_FILE: *n.??? n: 00-99

--u clear all.

--draw-box=INDEX=START_X=START_y=HORIZ=VERT=LINEWIDTH=COLOR.

INDEX:1-16; COLOR:24-bit color; LINEWIDTH:1-255; all dimensions in pixels.

--draw-box=INDEX to delete the specified index.

--draw-box= to delete all indexes.

2018-03 and later
--string=[X]=[-]Y=COLOR="STRING" No X indicates horizontal centering. -Y means count from the bottom of the menu. -0 is the last line.

2018-06-28 and later
setmenu --middle-align will centre all menu entries and help text
setmenu --box l=0 removes numbers and highlighted space at left of menub

 

:duff:

Wonko



#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 02 August 2019 - 02:52 PM

1. The new version seems OK. There will be an improved versions soon.

2. I already gave an example.

 

Tip: In grub4dos, if you go to the console and type

help setmenu

it will give you help on the setmenu command (surprisingly!)

 

The new version (not yet available) will allow you to specify the format too so you can have US date format or use English months (e.g. 'Aug') instead of a numeric month value.

see the issue log here if you want to keep track of it and other issues.



#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 August 2019 - 02:59 PM

The new version (not yet available) will allow you to specify the format too so you can have US date format or use English months (e.g. 'Aug') instead of a numeric month value.

Wow :w00t: ... incredible.

 

Isn't there a risk that the suspense might simply  kill some member? (also given the heat wave and the slow afternoons?) :ph34r: 

 

:duff:

Wonko



#10 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 02 August 2019 - 03:01 PM

A beta can be downloaded from the Issue link I just gave if you want to try it :P



#11 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 August 2019 - 03:18 PM

A beta can be downloaded from the Issue link I just gave if you want to try it :P

Naaah, I'll wait for the final release, though of course I have no use for the "feature", now, if you manage to trick Yaya into adding stardate[1], that would be another thing.

 

https://en.wikipedia.org/wiki/Stardate

 

Bonus if you can convince him to also print its spelling, i.e. 43989.1 as "four-three-nine-eight-nine point one" :whistling:

 

 

:duff:

Wonko

 

[1] the good thing about Stardate is that - like time - is relative, accordingly to the original definition:

 

The progression of stardates in your script should remain constant but don't worry about whether or not there is a progression from other scripts. Stardates are a mathematical formula which varies depending on location in the galaxy, velocity of travel, and other factors, can vary widely from episode to episode.



#12 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 02 August 2019 - 03:29 PM

Great idea. And using the beep command it should be possible to synthesise Captain Kirks voice so he can speak it in words on boot up 'captains log stardate 134664'.
Now what's the conversion algorithm?

#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 August 2019 - 03:58 PM

Great idea. And using the beep command it should be possible to synthesise Captain Kirks voice so he can speak it in words on boot up 'captains log stardate 134664'.
Now what's the conversion algorithm?

You can use the (good ol') SuStel one, it comes with a number of examples in various programming and scripting languages:

http://www.trimboli.name/stardate.html

including Powershell:

http://www.trimboli....et-Stardate.ps1

 

Here is "direct" javascript:

http://www.trimboli....jsstardate.html

 

and no, Captain Kirk could have never said "stardate 134664", you need the decimal point (at the very least to let William Shatner rest his voice on it and have a microsecond of time to contemplate himself in a mirror, to be reassured that he is still so handsome).

 

:duff:

Wonko



#14 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 03 August 2019 - 06:41 AM

@Wonko: You call it RTC, but isn't it also synonymous with CMOS (same thing)?



#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 August 2019 - 08:36 AM

@Wonko: You call it RTC, but isn't it also synonymous with CMOS (same thing)?

Yes and no.

 

Yes it is usually the same chip, no, it has a different function.

 

RTC is the Real Time Clock i.e. the actual thing that "ticks" and keeps time, the CMOS is - loosely - a chip technology:

https://it.wikipedia.org/wiki/CMOS

that was used in a dedicated chip to store some values (settings) of the BIOS (what you set via the BIOS interface).

 

Hence the common "CMOS" or CMOS chip terminology used in PC speak, such as "reset the CMOS".

 

This circuit for settings storage was soon integrated in the same chip as the RTC[1] (as basically they are the only parts of the motherboard that are battery powered), see also:

and I don't think that actual CMOS technology is used anymore since many years, replaced by "flash" chips or similar.

 

It would be more correct to call it "Nonvolatile BIOS memory" or more generically NVRAM:

https://en.wikipedia...ile_BIOS_memory

 

:duff:

Wonko

 

 

[1] I seem to remember that the IBM PC-AT was the first one to have this chip, see:

http://bochs.sourcef...S-reference.txt


  • wimb likes this

#16 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 03 August 2019 - 09:19 AM

IBM PCs used the 'Dallas' DS1287 chip which had the battery embedded onto the chip. When the battery went flat you had to replace the whole thing or tack on a coin cell...  Hopefully the chip was socketted to allow easy replacement.

 

https://www.classic-...attery-chip.htm


  • wimb likes this

#17 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 03 August 2019 - 10:11 AM

Well, there is BIOS and UEFI. Do they use different methods for storing info like the time, settings, etc? My understanding is that classical BIOS is very limited in its' abilities and functions, whereas UEFI has protocols, services, etc. And then there is "UEFI BIOS" (which I have read doesn't really exist.



#18 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 August 2019 - 11:59 AM

Well, there is BIOS and UEFI. Do they use different methods for storing info like the time, settings, etc? My understanding is that classical BIOS is very limited in its' abilities and functions, whereas UEFI has protocols, services, etc. And then there is "UEFI BIOS" (which I have read doesn't really exist.

And it's again a yes and no, your understanding is wrong (while being perfectly right :w00t:).

 

If we say that BIOS maxes out at 100 as potential and 100 in simplicity/compatibility, it is used commonly at 99 of potential offering  99 of simplicity (with some exceptions, I am looking at you Insyde2).

It just works.

 

On the other hand, UEFI has 1000 as potential and 50 in simplicity/compatibility, and it is used at the very most at 110 of its potential (and at least 10% of that simply doesn't work properly) and at 5 in simplicity/compatibility.

It also just works (when it works).

 

Imagine racing a go-kart (BIOS) against a Ferrari (UEFI) but with the Ferrari being artificially limited at max 2000 RPM AND with the gearbox stuck in first gear, more or less the performances will be the same, but things that can go wrong on the two vehicles are very different, as well as the reliability.

 

UEFI is to all practical effect a complete computing environment, not entirely unlike - to give you an idea - DOS+Win3.1, the issue is that noone wants (or can) write working and useful programs running on it, partially also due to the non-standard implementation of the standard and its utter complexity.

 

UEFI BIOS actually exists, but is called differently, it is UEFI CSM (CSM stands for Compatibility Support Module) in practice most UEFI firmwares contain a BIOS, or - maybe even better, most UEFI implementations can emulate a BIOS. 

 

:duff:

Wonko



#19 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 03 August 2019 - 12:13 PM

@Wonko: Good comparison, I guess UEFI is kind of like an OS, it provides a framework for programs to run. But in reality it is very arcane.



#20 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 06 August 2019 - 09:06 AM

Support for 12-hour and 24-hour time has been added. New version should be out soon.

 

 

setmenu --string=x=y=color="date&time=FORMAT"

 

updates every second on menu.

 

Replaces any of  dd MM MMM yyyy hh HH mm ss AP, where MM = two digit month, MMM = three letter month (e.g. Aug), HH = two digit 24-hour, hh = two digit 12-hour, AP = AM or PM - e.g.

setmenu --string=67=0=0xffffff="date&time=[Date=dd/MM/yyyy Time=HH:mm:ss]" 

or 

setmenu --string=71=0=0xffffff="date&time=[dd-MMM-yyyy  hh:mm:ss AP]"


#21 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 August 2019 - 09:24 AM

Well, in the case of MMM there will be the need for an additional parameter, language.

 

And of course,  lots of people will want to read 1:12 PM (as opposed to 01:12 PM), so another parameter will be needed to suppress the leading zero.

 

:duff:

Wonko



#22 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 06 August 2019 - 09:38 AM

The ability for grub4dos to display a constantly updating date and time on the grub4dos menu screen is a major milestone.

Now you don't have to carry your watch or mobile phone with you just to know the time, just boot up on your nearest PC...

 

P.S.  why do we have  12:01 PM for one minute past noon and not 00:01 PM?

If I asked you to meet me at 00:00 (midnight)  on the 7th August, how long would you need to wait for me?

 

P.P.S. Is it true that there are 24 hours in a day, 60 seconds in a minute and 60 minutes in an hour because of the number of fingers and toes humans have?


Edited by steve6375, 06 August 2019 - 09:46 AM.


#23 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 August 2019 - 11:44 AM

The ability for grub4dos to display a constantly updating date and time on the grub4dos menu screen is a major milestone.

Now you don't have to carry your watch or mobile phone with you just to know the time, just boot up on your nearest PC...

 

P.S.  why do we have  12:01 PM for one minute past noon and not 00:01 PM?

If I asked you to meet me at 00:00 (midnight)  on the 7th August, how long would you need to wait for me?

 

P.P.S. Is it true that there are 24 hours in a day, 60 seconds in a minute and 60 minutes in an hour because of the number of fingers and toes humans have?

Sure, everyone has 24 fingers and 60 toes.

 

Guess why all the rest of the world uses "Zulu" times?

 

You mean that entering the BIOS and look at the time there wouldn't be good enough?

And of course you mean boot a computer which is setup to boot the latest-latest grub4dos AND with a menu showing the time.

 

 

Allow me to object on the *need* to carry a watch or a smartphone.

Carrying a watch at the sole scope of knowing time at a glance is "appropriate".

Carrying a smartphone at the sole scope of knowing the time is plain stupid (get a watch instead, if not anything else its batteries tend to last longer)

 

Now, the milestone will be when you will able to boot to grub4dos and make phone calls (and also be able to comment on twitter and post a couple lolcat images).

 

 

:duff:

Wonko



#24 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 06 August 2019 - 11:57 AM

Well you have four fingers on each hand and 3 joints on each finger (4*3*2=24). By using your thumb as a 'pointer' you can use one hand to signify the hour in a day. e.g. touch the thumb of your right hand to the top joint of the little finger of your right hand to mean 'noon'. (Egyptian?).

 

Similarly you have two hands and two feet = 20 'digits' with 3 joints in each = 60 (0-59). So point to your left big toe's top joint to mean 12 minutes past the hour. (Indian?).

 

Maybe we can use grub4dos to display the ancient time in graphics using hands and feet icons?



#25 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 August 2019 - 02:56 PM

Ancient time ?
 
We could use both a Tzolk'in and a Haabʼ. :)

Surely it would look good on a boot menu:

 

:duff:

Wonko







Also tagged with one or more of these keywords: grub4dos

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users