flat assembler
Message board for the users of flat assembler.

Index > OS Construction > int 19h

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I tell you what i will do, i like problems like this, so if we put our heads together we can fix it, so i will do some tests and get back to you Smile .
Post 13 Jan 2008, 17:11
View user's profile Send private message Reply with quote
Vov4ik



Joined: 20 May 2007
Posts: 28
Location: USSR, Moscow Region
Vov4ik
I tried to write a stub to int13 today, as i said earlier. It replaces HDDs, reads MBR from 80h HDD end executes it. But... it hangs. I tried to debug it, stub works correctly, reading of MBR passes well. Debugger hangs when MBR jumps to its copy at 0000:0600, i think because it overwrites some DOS handlers. (DOS handles int13 too, it adds some stub to BIOS handler). This is a source of my program and binary file.
Sorry, i still prefer TASM in ideal mode for DOS.


Description: A program with commented source.
Download
Filename: INT13CH.ZIP
Filesize: 1.49 KB
Downloaded: 134 Time(s)


_________________
MicroSoft? is that some kind of a toilet paper?
Sorry for my English . . .
Post 13 Jan 2008, 17:26
View user's profile Send private message ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
So , it shall restore the original bios before execution.
but how to make it? i suppose it's overwriten by DOS and OSes.
Post 13 Jan 2008, 17:31
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I have done some tests, it works fine in MiniDos, but in real Dos it freezers, i even rewritten all the interrupts form 32 to 256 to hook to a set ISR, but just the same.
I will do some more tests.

Why do you not write a floppy bootsector that comes up with a menu and asks what OS you want to boot.
It can than run your code to boot to hdd1 etc.
You can do a warm boot with this code
Code:
;Warm Boot By Dex (untested)        xor   ax,ax            ;*SET FLAG FOR WARM REBOOT*        mov   ds,ax            ; dos flags memory segment address        mov   si,0x0472        ; dos reboot type flag offset        mov   cx,0x1234        ; warm boot indicator        mov   word[ds:si],cx   ; set the flag                               ;*WARM REBOOT*        db    0xea             ; Machine language to jump to                               ; address FFFF:0000 (reboot)        dw    0x0000        dw    0xffff           ; No return required                               ; we're rebooting!        jmp $                    ; Just incase Wink    

You can then run the above code from Dos.


Last edited by Dex4u on 14 Jan 2008, 05:20; edited 1 time in total
Post 13 Jan 2008, 21:39
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Dex, why not just "jmp $FFFF:0"?
Post 13 Jan 2008, 22:16
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
because it cannot work for CD, i never tryed to rewrite the boot sector of a CD-R. can you do that?
Post 13 Jan 2008, 23:32
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
LocoDelAssembly wrote:
Dex, why not just "jmp $FFFF:0"?
By adding the first bit of the code, it does a warm boot (or cold boot, if you mov cx,0x0000).

@edfed, From my point of view, when booting from a CD-R, i use a bootable floppy image, as it's set to floppy emulation.
Post 14 Jan 2008, 03:43
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
I should be more specific Razz I mean why don't you use just the instruction instead of hard coding it with DBs.
Post 14 Jan 2008, 04:05
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
LocoDelAssembly wrote:
I should be more specific Razz I mean why don't you use just the instruction instead of hard coding it with DBs.

Oh i see Laughing , because it looks cool Wink , its common for this type of jump to be done like this.
Post 14 Jan 2008, 05:18
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
finally, i think that making a menu on boot sector is the solution to adopt.
this menu then launch the boot we need.
Post 14 Jan 2008, 15:13
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I have read that calling this will help
Code:
        mov ah,0Dh                   ; Disk Reset        int 21h                      ; causes SmartDrv 4.x to write cache        mov ax, 40h                  ; set up segment addressing        mov ds,ax        or  byte [ds:17h],0Ch        ; Same as pressing CTRL+ALT        mov ax,0x4f53                ; 53h = DEL scan code        int 15h                      ; EMM386 sees this & shuts down    


See here: http://www.freedos.org/freedos/news/technote/217.html
Post 14 Jan 2008, 21:53
View user's profile Send private message Reply with quote
System86



Joined: 15 Aug 2007
Posts: 77
System86
The simplest way to reboot, that works for both real mode and protected mode, is to write 0xFE to port 64h. Jumping to 0xFFFF:0x0000 is another way, but only works in real mode. For both cases, if the value at 0040h:0072h is 1234h, a warm boot will occur, if it is 0, a cold boot will occur. Other ways of reseting a CPU include generating a triple fault (by enabling pmode, lidt with size of IDT being 0, and generating an interrupt), using APM, ACPI, and INT 15h/AH=4Fh.
Post 15 Jan 2008, 00:53
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Not sure if this is what you want, but take a look at these (all except Gujin are written in asm):

Post 25 Jan 2008, 06:45
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
Post 30 Jan 2008, 03:02
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.