flat assembler
Message board for the users of flat assembler.
Index
> DOS > How would one go about acessing CMOS checksum values? |
Author |
|
mrblobles 12 May 2007, 21:12
*topic*
_________________ pokemon on my iPod = awesome |
|||
12 May 2007, 21:12 |
|
Hayden 15 May 2007, 03:19
Can you give us a code snippet?
Is your program for dos or windows? Why do you need to write to the cmos? for windows programs lots of ports are r/w protected depending on the applications privledge level. In general you should not be writting anything to cmos, except in the case were you want to restore cmos from a backup. you could accidently modify the drive geometries and other required settings needed by the bios wich could lead to catastrofic failure. even though there is lots of info about what bytes are in a cmos there is no common standard for cmos layout, this means that byte locations could be anything depending on the bios vendor, oem manufacturer etc... _________________ New User.. Hayden McKay. |
|||
15 May 2007, 03:19 |
|
mrblobles 19 May 2007, 20:07
well Im just trying to change the RTC, here is my code for changing the hour, I cant seem to get it to work
[code] format mz org 100h mov al,04h out 70h mov al,10 out 71h mov ah,4ch mov al,00 int 21h _________________ pokemon on my iPod = awesome |
|||
19 May 2007, 20:07 |
|
Goplat 19 May 2007, 21:52
"org 100h" is used in COM files, where the PSP and program contents are both accessed through the same segment, so the contents start at offset 100h. For EXE files, they are accessed through one or more separate segments, which start at offset 0. If you want a COM, lose the "format mz"; if you want an EXE, lose the "org 100h".
|
|||
19 May 2007, 21:52 |
|
mrblobles 19 May 2007, 22:15
well iv tried both but it doesnt help my problem
|
|||
19 May 2007, 22:15 |
|
LocoDelAssembly 19 May 2007, 22:46
If that is the correct procedure to write CMOS then try adding some delay loop in between the first OUT and the second.
And as Hayden said, you may have some troubles doing this inside Windows, try doing this from a **pure** DOS (it's fine to use a Win9x bootdisk or starting in MS-DOS mode). With Win9x/Me maybe you will get no problems but with a NT/XP is very likely that it will not work. |
|||
19 May 2007, 22:46 |
|
mrblobles 20 May 2007, 19:47
I was runnign this under XP, but what would adding delay loops do?
_________________ pokemon on my iPod = awesome |
|||
20 May 2007, 19:47 |
|
LocoDelAssembly 20 May 2007, 20:01
Give enough time to the CMOS to prepere itself for recieving new data on the recently new address. I have no examples in my mind now but some hardware needs those delays. However your primary problem here is running this under XP. Go to http://www.bootdisk.com/ and download a bootdisk. After creating it add your cmos.com to the disk and then boot your computer from it.
|
|||
20 May 2007, 20:01 |
|
mrblobles 20 May 2007, 20:05
I havent got a floppy drive can any of them be put on a cd in any way?
|
|||
20 May 2007, 20:05 |
|
Vov4ik 20 May 2007, 20:11
It will be enough delay, if you put "jmp $+2" instruction between two references to CMOS. (It is documented fact). And, i thing, NT-based vindozes does not allow to write something to CMOS. (may be except RTC)
PS Reading CMOS works well under NT. |
|||
20 May 2007, 20:11 |
|
Hayden 21 May 2007, 04:19
i've been a bit buisy the last couple off days but 'ill se if i can do some testing
_________________ New User.. Hayden McKay. |
|||
21 May 2007, 04:19 |
|
Hayden 21 May 2007, 07:39
Ok, here goes... i did some testing under windows 98 plus
If you modify the cmos rtc clock, you will not see the change until the next reboot. this is because windows reads the cmos once at boot time and then keeps track of the time internaly via the bios clock wich is attached to channel 0 on the PIT timers, wich is also hooked to int8. On windows, ( at least windows 98 ) I was unable to acces the bios data area, so you must use GetSystemTime() and GetSystemTime(). However on dos (untested) you could try... After updateing the cmos time you could try update the time in the bios data area as well. However it is possible that the windows/dos int8 handler may overwrite the updated time in the bios data area with some variables stored interanly inside the handler. On dos you should use int21 ah = 2c and ah = 2d Other notes: if your going to try modify the cmos clock, it is important to check the cmos byte at 0Bh, d1 will tell you weather the cmos time format is 12 or 24 hour time and d2 will tell you weather the cmos time format is BDC or HEX. This varies from machine to machine. As for the delay, it's only needed for old relics ie: an XT machine. modern mainboards can handle back to back i/o no probs Also here is some code to properly read and write the cmos Code: ; notes: registers are preserved, except al and interrupts are disabled to ; potect against some interrupt from putting the eprom in an unknown state ReadCmos: ; dl = byte location to read cli ; al = returned byte xchg al , dl out 70h, al xchg al , dl in al , 71h sti ret SendCmos: ; dl = byte location to send cli ; al = byte to send xchg al , dl out 70h, al xchg al , dl out 71h, al sti ret _________________ New User.. Hayden McKay. |
|||
21 May 2007, 07:39 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.