Correct floppy booting; increase "menu space tolerance" from 3 to 10.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@701 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2003-09-19 02:13:35 +00:00
parent 2e45c870eb
commit c4e02e8654
3 changed files with 19 additions and 25 deletions

View File

@ -315,12 +315,12 @@ STATIC struct table commands[] = {
int findend(BYTE * s)
{
int nLen = 0;
/* 'marks' end if at least three spaces, 0, or newline is found. */
/* 'marks' end if at least ten spaces, 0, or newline is found. */
while (*s && (*s != 0x0d || *s != 0x0a) )
{
BYTE *p= skipwh(s);
/* ah, more than two whitespaces ? We're done here (hrmph!) */
if((unsigned int)p - (unsigned int)s>=3)
/* ah, more than 9 whitespaces ? We're done here (hrmph!) */
if(p - s >= 10)
break;
nLen++;
++s;
@ -1124,6 +1124,7 @@ STATIC VOID CfgSwitches(BYTE * pLine)
pLine++; /* skip optional separator */
if (!isnum(*pLine))
{
pLine--;
Config.ebda2move = 0;
break;
}
@ -1983,7 +1984,7 @@ RestartInput:
}
else if(key == 0x5000 && MenuColor != -1) /* arrow down */
{
if(MenuSelected<10 && (Menus & (1 << (MenuSelected+1))) )
if(MenuSelected<MENULINESMAX && (Menus & (1 << (MenuSelected+1))) )
{
MenuSelected++;
}

View File

@ -158,17 +158,9 @@ cont: mov ax,cs
int 010h
popf
pop bx
xor ax,ax
mov es,ax
mov [es:0x5e0], bl ; store orig bootdrive:used by initdisk
pop ax
inc bl
jns floppy
mov bl,3 ; set to C: if hard disk
floppy: mov byte [_BootDrive],bl ; tell where we came from
mov byte [_BootDrive],bl ; tell where we came from
;!! int 11h
;!! mov cl,6

View File

@ -98,6 +98,8 @@ void fmemcpy(void far *dest, const void far *src, unsigned n)
VOID ASMCFUNC FreeDOSmain(void)
{
unsigned char drv;
#ifdef _MSC_VER
extern FAR prn_dev;
DosDataSeg = (__segment) & DATASTART;
@ -105,31 +107,30 @@ VOID ASMCFUNC FreeDOSmain(void)
LoL = &DATASTART;
#endif
/* if the kernel has been UPX'ed,
CONFIG info is stored at 50:e2 ..fc
and the bootdrive (passed from BIOS)
at 50:e0
*/
*/
if (fmemcmp(MK_FP(0x50,0xe0+2),"CONFIG",6) == 0) /* UPX */
{
UBYTE drv;
fmemcpy(&InitKernelConfig, MK_FP(0,0x5e0+2), sizeof(InitKernelConfig));
drv = *(UBYTE FAR *)MK_FP(0,0x5e0) + 1;
if (drv >= 0x80)
drv = 3; /* C: */
LoL->BootDrive = drv;
*(DWORD FAR *)MK_FP(0,0x5e0+2) = 0;
}
*(DWORD FAR *)MK_FP(0,0x5e0+2) = 0;
}
else
{
drv = LoL->BootDrive + 1;
*(UBYTE FAR *)MK_FP(0,0x5e0) = drv - 1;
fmemcpy(&InitKernelConfig, &LowKernelConfig, sizeof(InitKernelConfig));
}
if (drv >= 0x80)
drv = 3; /* C: */
LoL->BootDrive = drv;
setvec(0, int0_handler); /* zero divide */
setvec(1, empty_handler); /* single step */
setvec(3, empty_handler); /* debug breakpoint */