LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2004, 10:16 AM   #1
stonerudolph
LQ Newbie
 
Registered: Feb 2004
Posts: 1

Rep: Reputation: 0
int 13 doesnt work after linux switch to real mode


I have a idea for fast reboot.
Everytime we use linux for reboot the PC, when linux switch to real mode, read the MBR to 7c00, and jump to there.
This may eliminate the warm reboot time.
I had make two version of floppy linux(one use SYSLINUX, another use LILO) for test,
BUT every time when linux reboot, the PC is halt (It seem the BIOS interrup INT 13 doesnt work).
Would you give me some comment, thank you!

I modified the linux 2.4.22/arch/i386/kernel/process.c:

static unsigned char jump_to_bios [] =
{
- 0xea, 0x00, 0x00, 0xff, 0xff
+ 0xea, 0x05, 0x90, 0x00, 0x00, /* ljmp $0x0000, $0x1005 */
+ 0x33, 0xc0, /* xorw ax, ax */
+ 0x8e, 0xd0, /* movw ax, ss */
+ 0xbc, 0x00, 0x7b, /* movw $0x7b00, sp (ss:sp->0:7b00) */
+ 0xfb, /* sti */
+ 0x50, /* pushw ax */
+ 0x07, /* popw es */
+ 0x50, /* pushw ax */
+ 0x1f, /* popw ds -> ax=es=ds=0 */
+ 0xb8, 0x01, 0x02, /* movw $0x0201, ax */
+ 0xbb, 0x00, 0x7c, /* movw $0x7c00, bx (es:bx->0:7c00) */
+ 0xb9, 0x01, 0x00, /* movw $0x0001, cx */
+ 0xba, 0x80, 0x00, /* movw $0x0080, dx */
+ 0xcd, 0x13, /* int 13 */
+ 0xea, 0x00, 0x7c, 0x00, 0x00 /* ljmp $0x0000, $0x7c00 */
};


void machine_real_restart(unsigned char *code, int length)
{
......

- memcpy ((void *) (0x1000 - sizeof (real_mode_switch) - 100),
- real_mode_switch, sizeof (real_mode_switch));
- memcpy ((void *) (0x1000 - 100), code, length);

+ memcpy ((void *) (0x9000 - sizeof (real_mode_switch)),
+ real_mode_switch, sizeof (real_mode_switch));
+ memcpy ((void *) 0x9000, code, length);

.......

- __asm__ __volatile__ ("ljmp $0x0008,%0"
- :
- : "i" ((void *) (0x1000 - sizeof (real_mode_switch) - 100)));

+ __asm__ __volatile__ ("ljmp $0x0008,%0"
+ :
+ : "i" ((void *) (0x9000 - sizeof (real_mode_switch))));
}
 
Old 08-13-2004, 05:40 AM   #2
zidyrick
LQ Newbie
 
Registered: Aug 2004
Posts: 1

Rep: Reputation: 0
I think the Linux has broken real_mode environment(idt,and so on ),so int 13h doesnt work
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesnt my USB mouse doesnt work? barkha Linux - Hardware 2 08-16-2005 11:31 AM
Getting a KVM Switch to work with Linux MooMooFarm Linux - Hardware 5 11-16-2004 03:43 PM
real noob, trying to survive in linux -audigy soundcard wont work- palidang Debian 5 07-28-2004 11:27 AM
Give people a real reason to switch to LINUX jaz General 21 05-04-2004 09:54 PM
switch statement converting struct char to struct int oceaneyes2 Programming 2 12-10-2003 04:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration