Re: [edk2] Generating random numbers in UEFI

2013-01-07 Thread Sorin Vinturis
Thanks Laszlo for pointing that out. It appears that the rand() function is implemented on 32 bits in UEFI StdLib, instead of 16 bits as I was expecting.  In this case the generated numbers are correct. From: Laszlo Ersek To: Sorin Vinturis ; edk2-devel@lists.s

Re: [edk2] strings on HII expression stack

2013-01-07 Thread Tim Lewis
Bill - The expression evaluator must use the actual string values, as you expect. Section 28.2.5.7.4 says that a string value in an expression is a "Null-terminated string" not a string ID. Furthermore, some operations, like Mid() and Token() actually create new string values. Which string id

[edk2] strings on HII expression stack

2013-01-07 Thread Bill_Munger
HII has a number of opcodes which can push/pop string values on the HII expression stack (like the opcodes in the list below). The language in the UEFI spec made me think that form processors push/pop the actual strings (not HII string IDs). However, after looking at the EDK2 browser code I get

Re: [edk2] I'm new to Hii fonts and have some basic questions...

2013-01-07 Thread Thomas Rognon
Tim, Thanks! In that case I'll either have to become a unicode expert and make my own fonts or I'll hack it by using bitmaps as my letters. I think I'm just going to use bitmaps :) Thomas On Thu, Jan 3, 2013 at 7:12 PM, Tim Lewis wrote: > Thomas – > > ** ** > > The EDK2 implementation

Re: [edk2] Generating random numbers in UEFI

2013-01-07 Thread Laszlo Ersek
On 01/07/13 16:30, Sorin Vinturis wrote: > Does anyone knows why the generated numbers are over RAND_MAX, which is > 32767? >From "StdLib/Include/stdlib.h": 160 /** Expands to an integer constant expression that is the maximum value 161 returned by the rand function. 162 **/ 1

[edk2] Generating random numbers in UEFI

2013-01-07 Thread Sorin Vinturis
Hi, I am trying to generate random numbers in UEFI. For this I am using the StdLib wrapper in order to call rand() function. The problem I am having is that I am expecting that the generated random number to be in the [0, RAND_MAX) range, but the generated number is way bigger than that. Thi