home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Complet / FreeDOS / fdbootcd.iso / isolinux / DATA / FDBOOT.IMG / FREEDOS / FDAUTO.BAT < prev    next >
DOS Batch File  |  2004-04-15  |  5KB  |  142 lines

  1. @echo off
  2. if "%config%"=="2" goto BOOT_CHK
  3. echo attempting to load the UDMA driver (386+). It's an experimental driver.
  4. echo To bypass loading this driver, select option 2 from bootdisk.
  5. if exist a:\driver\udma.sys a:\driver\devload a:\driver\udma.sys
  6. goto BOOT_CHK
  7.  
  8. :BOOT_CHK
  9. set disksrc=A:
  10. set bootsrc=realdisk
  11. set cputype=80186
  12. ifmemdsk.com
  13. if "%errorlevel%"=="255" set cputype=80286
  14. for %%x in ( 254 255 ) do if "%errorlevel%"=="%%x" goto errormsg
  15. rem No cdrom supported on 8086/80186/80286 platforms, so don't even try..
  16. set cputype=80386
  17. getargs > temp.bat
  18. if exist temp.bat call temp.bat
  19. if exist temp.bat del temp.bat
  20. if not "%BOOT_IMAGE%"=="" set bootsrc=fakedisk
  21. goto load_ELT
  22.  
  23. :load_ELT
  24. if exist a:\driver\eltorito.sys a:\driver\devload /H a:\driver\eltorito.sys /D:FDCD0001
  25. if not exist FDCD0001 goto load_IDE
  26. if "%bootsrc%"=="fakedisk" set bootsrc=cdrom
  27. goto aspi_chk
  28.  
  29. :load_IDE
  30. if "%bootsrc%"=="fakedisk" set disksrc=B:
  31. set cdname=FDCD0001
  32. if exist FDCD0001 set cdname=FDCD0002
  33. set ide-list=
  34. for %%x in ( %disksrc%\driver\vide-cdd.sys a:\driver\vide-cdd.sys a:\driver\atapicdd.sys ) do if exist %%x set ide-list=%ide-list% %%x
  35. for %%x in ( %ide-list% ) do if not exist %cdname% a:\driver\devload /H %%x /D:%cdname%
  36. set ide-list=
  37. goto aspi_chk
  38.  
  39. :aspi_chk
  40. if "%config%"=="4" goto SCSI_HBA
  41. for %%x in ( ASPIMGR$ SCSIMGR$ ) do if exist %%x goto SCSI_CDR
  42. goto loadcach
  43.  
  44. :SCSI_HBA
  45. echo You selected loading custom driver(s). (from drive %disksrc%?)
  46. echo Enter complete filename and load parameters
  47. set /p filename=(or hit ENTER to skip)
  48. if "%filename%"=="" goto SCSI_CDR
  49. rem wish we could get 1st parameter here, and check if it exists.
  50. rem FOR loop risks other parameters to also exist...
  51. echo Attempting to load custom driver.
  52. a:\driver\devload %filename%
  53. set filename=
  54. goto SCSI_HBA
  55.  
  56. :SCSI_CDR
  57. rem Here goes the SCSI CDROM driver (until ATAPICDD supports it)
  58. echo You selected loading custom driver(s). (from drive %disksrc%)
  59. echo Enter complete filename for cdrom-driver
  60. set /p filename=(or hit ENTER to skip)
  61. if "%filename%"=="" goto loadcdex
  62. if exist FDCD0001 set cdname=FDCD002
  63. if exist FDCD0002 set cdname=FDCD003
  64. if exist FDCD0003 set cdname=FDCD004
  65. if exist FDCD0004 set cdname=FDCD005
  66. if exist FDCD0005 set cdname=FDCD006
  67. if exist FDCD0006 goto loadcach
  68. if exist %filename% A:\DRIVER\DEVLOAD /H %filename% /D:%cdname%
  69. if not exist %filename% echo Invalid, missing or corrupt driver file
  70. goto SCSI_CDR
  71.  
  72. :loadcach
  73. for %%x in ( 1 2 3 4 5 6 ) do set cdname%%x=FDCD000%%x
  74. if "%config%"=="2" goto loadcdex
  75. for %%x in ( 1 2 3 4 5 6 ) do if exist %cdname%%x% A:\DRIVER\DEVLOAD /H A:\DRIVER\CDRCACHE.SYS %cdname%%x% CDRCACH%%x %buffsize%
  76. for %%x in ( 1 2 3 4 5 6 ) do if exist CDRCACH%%x set cdname%%x=CDRCACH%%x
  77. set buffsize=
  78. goto loadcdex
  79.  
  80. :loadcdex
  81. a:\driver\shsucdx.exe /D:?%cdname1%,X /D:?%cdname2%,W /D:?%cdname3%,V /D:?%cdname4%,U /D:?%cdname5%,T /D:?%cdname6%,S
  82. for %%x in ( 1 2 3 4 5 6 ) do set CDname%%x=
  83. for %%x in ( 1 2 3 4 5 6 ) do if exist FDCD000%%x goto findcd
  84. set cdrom=false
  85. goto errormsg
  86.  
  87. :findcd
  88. set loadbat=
  89. rem CD Detection: random file in root, autorun.bat in directories isolinux and freedos
  90. for %%x in ( S T U V W X ) do if exist %%x:\*.* set loadbat=%%x:\
  91. for %%x in ( S T U V W X ) do if exist %%x:\ISOLINUX\AUTORUN.BAT set loadbat=%%x:\ISOLINUX\
  92. for %%x in ( S T U V W X ) do if exist %%x:\FREEDOS\SETUP\BATCH\AUTORUN.BAT set loadbat=%%x:\FREEDOS\SETUP\BATCH\
  93. if "%loadbat%"=="" goto errormsg
  94. CDD %loadbat%
  95. CD \
  96. set cdrom=%_CWD%
  97. goto loadmenu
  98.  
  99. :loadmenu
  100. if not exist %loadbat%autorun.bat goto errormsg
  101. call %loadbat%autorun.bat
  102. GOTO end
  103.  
  104. :errormsg
  105. cls
  106. if "%cdrom%"=="" set cdrom=fake
  107. if "%loadbat%"=="" set loadbat=fake
  108. echo The installation bootdisk encountered an error in performing a cd-rom install
  109. echo possible error(s):
  110. if exist %cdrom%*.*      echo * Cd-rom disk inserted, but not FreeDOS cd-rom (but driver was loaded)
  111. if "%loadbat%"==""       echo * No (FreeDOS) cd-rom inserted (or no files found in root of cdrom)
  112. if "%cdrom%"=="false"    set loadbat=
  113. if "%cdrom%"=="false"    echo * failed to load cd-rom driver
  114. if "%cputype%"=="80286"  echo * a 386 processor (or newer) is required for cd-rom install
  115. echo.
  116. echo What do you want to do about this (type number and press ENTER to confirm):
  117. echo.
  118. echo         1) I've inserted the FreeDOS cd-rom and want to redetect it.
  119. echo         2) I have FreeDOS diskettes, and want to install from these media.
  120. echo         3) I give up. please drop me to the commandline.
  121. set /p option=                Your choice? [1,2,3]:
  122. if "%option%"=="1" goto findcd
  123. if "%option%"=="2" goto loaddsk1
  124. if "%option%"=="3" goto end
  125.  
  126. :loaddsk1
  127. echo Determining if you have a drive C: available to install FreeDOS to . . .
  128. whichfat C:
  129. if "%errorlevel%"=="1" Fdisk /MONO
  130. rem disk was unpartitioned
  131. disk2.bat
  132.  
  133.  errorlevels:
  134.  
  135. 1=no C: partition
  136. 12=FAT12 or unformatted
  137. 16=FAT16
  138. 32=FAT32
  139.  
  140. *** Fdisk:
  141. 6=no harddisk detected.
  142. :END