mirror of https://github.com/FDOS/kernel.git
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:
parent
2e45c870eb
commit
c4e02e8654
|
@ -315,12 +315,12 @@ STATIC struct table commands[] = {
|
||||||
int findend(BYTE * s)
|
int findend(BYTE * s)
|
||||||
{
|
{
|
||||||
int nLen = 0;
|
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) )
|
while (*s && (*s != 0x0d || *s != 0x0a) )
|
||||||
{
|
{
|
||||||
BYTE *p= skipwh(s);
|
BYTE *p= skipwh(s);
|
||||||
/* ah, more than two whitespaces ? We're done here (hrmph!) */
|
/* ah, more than 9 whitespaces ? We're done here (hrmph!) */
|
||||||
if((unsigned int)p - (unsigned int)s>=3)
|
if(p - s >= 10)
|
||||||
break;
|
break;
|
||||||
nLen++;
|
nLen++;
|
||||||
++s;
|
++s;
|
||||||
|
@ -1124,6 +1124,7 @@ STATIC VOID CfgSwitches(BYTE * pLine)
|
||||||
pLine++; /* skip optional separator */
|
pLine++; /* skip optional separator */
|
||||||
if (!isnum(*pLine))
|
if (!isnum(*pLine))
|
||||||
{
|
{
|
||||||
|
pLine--;
|
||||||
Config.ebda2move = 0;
|
Config.ebda2move = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1983,7 +1984,7 @@ RestartInput:
|
||||||
}
|
}
|
||||||
else if(key == 0x5000 && MenuColor != -1) /* arrow down */
|
else if(key == 0x5000 && MenuColor != -1) /* arrow down */
|
||||||
{
|
{
|
||||||
if(MenuSelected<10 && (Menus & (1 << (MenuSelected+1))) )
|
if(MenuSelected<MENULINESMAX && (Menus & (1 << (MenuSelected+1))) )
|
||||||
{
|
{
|
||||||
MenuSelected++;
|
MenuSelected++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,17 +158,9 @@ cont: mov ax,cs
|
||||||
int 010h
|
int 010h
|
||||||
popf
|
popf
|
||||||
pop bx
|
pop bx
|
||||||
|
|
||||||
xor ax,ax
|
|
||||||
mov es,ax
|
|
||||||
mov [es:0x5e0], bl ; store orig bootdrive:used by initdisk
|
|
||||||
|
|
||||||
pop ax
|
pop ax
|
||||||
|
|
||||||
inc bl
|
mov byte [_BootDrive],bl ; tell where we came from
|
||||||
jns floppy
|
|
||||||
mov bl,3 ; set to C: if hard disk
|
|
||||||
floppy: mov byte [_BootDrive],bl ; tell where we came from
|
|
||||||
|
|
||||||
;!! int 11h
|
;!! int 11h
|
||||||
;!! mov cl,6
|
;!! mov cl,6
|
||||||
|
|
|
@ -98,6 +98,8 @@ void fmemcpy(void far *dest, const void far *src, unsigned n)
|
||||||
|
|
||||||
VOID ASMCFUNC FreeDOSmain(void)
|
VOID ASMCFUNC FreeDOSmain(void)
|
||||||
{
|
{
|
||||||
|
unsigned char drv;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
extern FAR prn_dev;
|
extern FAR prn_dev;
|
||||||
DosDataSeg = (__segment) & DATASTART;
|
DosDataSeg = (__segment) & DATASTART;
|
||||||
|
@ -105,31 +107,30 @@ VOID ASMCFUNC FreeDOSmain(void)
|
||||||
LoL = &DATASTART;
|
LoL = &DATASTART;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* if the kernel has been UPX'ed,
|
/* if the kernel has been UPX'ed,
|
||||||
CONFIG info is stored at 50:e2 ..fc
|
CONFIG info is stored at 50:e2 ..fc
|
||||||
and the bootdrive (passed from BIOS)
|
and the bootdrive (passed from BIOS)
|
||||||
at 50:e0
|
at 50:e0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (fmemcmp(MK_FP(0x50,0xe0+2),"CONFIG",6) == 0) /* UPX */
|
if (fmemcmp(MK_FP(0x50,0xe0+2),"CONFIG",6) == 0) /* UPX */
|
||||||
{
|
{
|
||||||
UBYTE drv;
|
|
||||||
|
|
||||||
fmemcpy(&InitKernelConfig, MK_FP(0,0x5e0+2), sizeof(InitKernelConfig));
|
fmemcpy(&InitKernelConfig, MK_FP(0,0x5e0+2), sizeof(InitKernelConfig));
|
||||||
|
|
||||||
drv = *(UBYTE FAR *)MK_FP(0,0x5e0) + 1;
|
drv = *(UBYTE FAR *)MK_FP(0,0x5e0) + 1;
|
||||||
if (drv >= 0x80)
|
*(DWORD FAR *)MK_FP(0,0x5e0+2) = 0;
|
||||||
drv = 3; /* C: */
|
}
|
||||||
LoL->BootDrive = drv;
|
|
||||||
|
|
||||||
*(DWORD FAR *)MK_FP(0,0x5e0+2) = 0;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
drv = LoL->BootDrive + 1;
|
||||||
|
*(UBYTE FAR *)MK_FP(0,0x5e0) = drv - 1;
|
||||||
fmemcpy(&InitKernelConfig, &LowKernelConfig, sizeof(InitKernelConfig));
|
fmemcpy(&InitKernelConfig, &LowKernelConfig, sizeof(InitKernelConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (drv >= 0x80)
|
||||||
|
drv = 3; /* C: */
|
||||||
|
LoL->BootDrive = drv;
|
||||||
|
|
||||||
setvec(0, int0_handler); /* zero divide */
|
setvec(0, int0_handler); /* zero divide */
|
||||||
setvec(1, empty_handler); /* single step */
|
setvec(1, empty_handler); /* single step */
|
||||||
setvec(3, empty_handler); /* debug breakpoint */
|
setvec(3, empty_handler); /* debug breakpoint */
|
||||||
|
|
Loading…
Reference in New Issue