flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Performing a warm reboot |
Author |
|
pseudoterminal 26 Jul 2005, 16:38
Hello all. I have recently just started with FASM; I have to say, it's an excellent assembler.
I am interested in performing a warm reboot on the system -- by reading, I have learned that int 19h is NOT the way to go for this. So after googling a bit, I came across the following page on BIOS interrupts - http://www.xaff.org/GI/biosref.html -- instead of just saying "Do NOT use int 19h", it gave some instructions on performing a warm reboot, which are: Quote:
So after doing a bit more reading, I think I found out how to properly follow these instructions and put it into code. This code seems to work, but I don't know if it is entirely correct. The assembly code I have managed to create from these instructions is: Code: ; -- Snippet -- ; mov ax, 0x0040 ; AX = 0x0040 mov es, ax ; ES = AX mov di, 0x0072 ; DI = 0x0072 (our offset is ES:DI) mov ax, 0x1234 ; AX = 0x1234 stosw ; Put AX at ES:DI jmp 0FFFFh:0000h ; Jump to reboot. Is this correct? I understand that there is a clear difference between 'working' and 'correct'. This message may not belong under 'OS Construction', but I am working up towards making a small bootloader, so I wasn't sure where to go. Thanks for any help, -pty |
|||
26 Jul 2005, 16:38 |
|
LocoDelAssembly 27 Jul 2005, 17:25
This one is one byte less (13 bytes)
Code: push 40h pop ds mov word [0072h], 1234h push 0FFFBh push ds retf |
|||
27 Jul 2005, 17:25 |
|
pseudoterminal 27 Jul 2005, 21:27
Thanks for the code locodelassembly; it works perfectly, and is small too.
-pty |
|||
27 Jul 2005, 21:27 |
|
zhak 05 Aug 2005, 22:14
If you're making an error handling routine for a boot sector than it is better, i think, to use INT 18h. BIOS developers suggest this to give the control back to BIOS and try to boot the next IPL Device. Take a look at BIOS Boot Specification for more information.
Last edited by zhak on 08 Aug 2005, 16:19; edited 1 time in total |
|||
05 Aug 2005, 22:14 |
|
LocoDelAssembly 05 Aug 2005, 23:59
[edit]I took this from ralf brown's interrupt list[/edit]
INT 19 - SYSTEM - BOOTSTRAP LOADER Desc: This interrupt reboots the system without clearing memory or restoring interrupt vectors. Because interrupt vectors are preserved, this interrupt usually causes a system hang if any TSRs have hooked vectors from 00h through 1Ch, particularly INT 08. Notes: Usually, the BIOS will try to read sector 1, head 0, track 0 from drive A: to 0000h:7C00h. If this fails, and a hard disk is installed, the BIOS will read sector 1, head 0, track 0 of the first hard disk. This sector should contain a master bootstrap loader and a partition table (see #00650). After loading the master boot sector at 0000h:7C00h, the master bootstrap loader is given control (see #00653). It will scan the partition table for an active partition, and will then load the operating system's bootstrap loader (contained in the first sector of the active partition) and give it control. true IBM PCs and most clones issue an INT 18 if neither floppy nor hard disk have a valid boot sector to accomplish a warm boot equivalent to Ctrl-Alt-Del, store 1234h in 0040h:0072h and jump to FFFFh:0000h. For a cold boot equivalent to a reset, store 0000h at 0040h:0072h before jumping. INT 18 - DISKLESS BOOT HOOK (START CASSETTE BASIC) Desc: called when there is no bootable disk available to the system Notes: very few PCs other than those produced by IBM contain BASIC in ROM, so the action is unpredictable on compatibles; this interrupt often reboots the system, and often has no effect at all some PC and XT clones had an optional IBM CASSETTE BASIC stored in the ROM, too. most BIOSes will display an error message similar to "NO BASIC", and either reboot or return to the caller. PS/2 machines usually pop up a graphical box to the effect that the user should enter a floppy and press F1. Some clones display the message "No boot device available, strike F1 to retry, F2 for setup utility" network cards with their own BIOS can hook this interrupt to allow a diskless boot off the network (even when a hard disk is present if none of the partitions is marked as the boot partition) |
|||
05 Aug 2005, 23:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.