File: global.conf

package info (click to toggle)
dosemu 1.4.0%2Bsvn.1999-2
  • links: PTS
  • area: contrib
  • in suites: squeeze
  • size: 15,552 kB
  • ctags: 22,600
  • sloc: ansic: 136,915; asm: 4,107; sh: 1,606; perl: 1,411; makefile: 974; tcl: 599; awk: 404; yacc: 300; lex: 157
file content (725 lines) | stat: -rw-r--r-- 22,782 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
##############################################################################
# WARNING: THIS FILE IS NOT USED BY DEFAULT. ADJUST dosemu.users OR USE -F.
#
# This file is global.conf. By default a compiled-in copy is used. If you
# make custom changes to the settings in this file, then you need to use 
# the -F switch or change dosemu.users; the custom file is then parsed
# after the built-in copy.
#
# Linux dosemu  configuration  for parser versions >= 3 (dosemu-0.97.0.1)
#
# ./doc/README-tech.txt (chapter 2.) contains a description of the syntax
# and the usage. However, you normally won't edit this file !!
#
# NOTES:
#
# 1. The file dosemu.conf (and optionally ~/.dosemurc) contains variable
#    settings, that are included by global.conf for doing the
#    most reasonable configuration.
#    The file dosemu.conf (and optionally ~/.dosemurc) is what gets
#    updated by the menu driven 'setup-dosemu' tool.
#
# 2. We strongly recommend you to edit ONLY dosemu.conf.
#    If you change global.conf, you are at your own and could break
#    'setup-dosemu'.  You really need to know a lot of DOSEMU
#    internals before you fiddle with editing global.conf.
#    However, some very special cases can only be handled in global.conf.
#    
# 3. The file global.conf (this one) is either
#      - the one compiled into dosemu.bin.
#      - specified by the config_script option in dosemu.users ("builtin" 
#        by default)
#      - or given via the -F option (from root login, else only on
#        non-suid-root DOSEMU)
#
# 4. The only compiled-in path is /etc/dosemu.users (or if not found
#    /etc/dosemu/dosemu.users), however, this can be overridden by
#    --Fusers, if not running suid-root. All other paths are configurable
#    and the dosemu binaries can reside everywhere in the system.
#
# This file (global.conf) may also serve as an example file for
#      .dosrc            ( old style user configuration file )
#      option -I         ( configuration via commandline, see man/dos.1 )
#
# Access rights for suid-root running DOSEMU sessions are defined in
#
#      /etc/dosemu.users or /etc/dosemu/dosemu.users
#
##############################################################################

ifdef u_forceold
  undef parser_version_3
  define version_3_style_used
endif

ifndef parser_version_3
  # normally won't come here, because older DOSEMUs don't use this file
  # ... but if using -F option ...
  include "/etc/dosemu.conf"
else
  # we are on version 3 parser

  ## we set some vital variable

  if (!strlen($DOSEMU_LIB_DIR))
    # be sure, because older DOSEMU won't set this
    $DOSEMU_LIB_DIR = "/var/lib/dosemu";
    $DOSEMU_CONF_DIR = "/etc";
    $DOSEMU_HDIMAGE_DIR = $DOSEMU_LIB_DIR;
  else
    if (!strlen($DOSEMU_HDIMAGE_DIR))
      $DOSEMU_HDIMAGE_DIR = $DOSEMU_LIB_DIR;
    endif
    # make sure we have absolute paths
    shell("test -d ", $DOSEMU_HDIMAGE_DIR)
    if ($DOSEMU_SHELL_RETURN)
      $DOSEMU_HDIMAGE_DIR = /var/lib/dosemu
    else
      $DOSEMU_HDIMAGE_DIR = shell("cd ", $DOSEMU_HDIMAGE_DIR, "; pwd -P");
      $DOSEMU_HDIMAGE_DIR = strdel($DOSEMU_HDIMAGE_DIR, strlen($DOSEMU_HDIMAGE_DIR)-1, 1);
    endif
    shell("test -d ", $DOSEMU_LIB_DIR)
    if ( $DOSEMU_SHELL_RETURN)
      $DOSEMU_LIB_DIR = "/var/lib/dosemu";
    else
      $DOSEMU_LIB_DIR = shell("cd ", $DOSEMU_LIB_DIR, "; pwd -P");
      $DOSEMU_LIB_DIR = strdel($DOSEMU_LIB_DIR, strlen($DOSEMU_LIB_DIR)-1, 1);
    endif
  endif

  $CONFIG_VERSION = ( (1 << 24) | (1 << 16) | (4 << 8) | 0)
  #                    ^           ^           ^         ^
  if ( $DOSEMU_VERSION_CODE < $CONFIG_VERSION )
    abort "
*** sorry, your ", $DOSEMU_LIB_DIR, "/global.conf doesn't match this dosemu version
"
  endif

  $DOSEMU_VERSION = ($DOSEMU_VERSION_CODE >> 24), '.',
                    (($DOSEMU_VERSION_CODE >> 16) & 255), '.',
                    (($DOSEMU_VERSION_CODE >> 8) & 255), '.',
                    ($DOSEMU_VERSION_CODE & 255);

  $LIST_DELIM = " ,	"	#delimiters for lists <tab>, blank, comma

  # for non-suid-root we can switch off restricted checking.
  if (strlen($DOSEMU_LAX_CHECKING))
    undef restricted
    undef guest
  endif

  # we include the global settings from $DOSEMU_CONF_DIR/dosemu.conf
  if (strlen($DOSEMU_CONF_DIR))
    shell("test -f ", $DOSEMU_CONF_DIR, "/dosemu.conf")
    if ( $DOSEMU_SHELL_RETURN)
      $DOSEMU_CONF_DIR = ""
    endif
  endif

  undef version_3_style_used    # unset it to have a valid check below
  if (strlen($DOSEMU_CONF_DIR))
    $xxx = 'include "', $DOSEMU_CONF_DIR, '/dosemu.conf"';
    $$xxx;
    ifndef version_3_style_used
      abort "
*** Your ", $DOSEMU_CONF_DIR, "/dosemu.conf is obviously an old style or a too simple one.
    Please read Quickstart and README.txt on how to upgrade.
"
    endif
  endif

  ## we check if we have an ${HOME}/.dosemurc (given by $DOSEMU_RC),
  ## if yes, we include it here 'under user scope', which means it has
  ## all c_* classes undefined and can only change environment variables in
  ## its own isolated name space (prefixed with 'dosemu_').
  ## We later take over only such variables, that we allow.

  $_dosemurc = $DOSEMU_RC         # we get that passed from 'parse_config()'
  shell("test -f ", $_dosemurc)
  if ( (!$DOSEMU_SHELL_RETURN) ) 
    # we have a .dosemurc and can include
    $_dosemurc = ' include "', $_dosemurc, '"';
    if (!strlen($DOSEMU_LAX_CHECKING))
      enter_user_scope;
    endif
    $$_dosemurc;
    if (!strlen($DOSEMU_LAX_CHECKING))
      leave_user_scope;
    endif
    define skip_dosrc;

    ## now we take over the allowed variables, only those which exist
    ## with 'dosemu_' prefixed will overwrite those without the prefix.

    checkuservar $_debug, $_trace_ports,
      $_features, $_mapping, $_hogthreshold, $_cli_timeout, $_pic_watchdog,
      $_timemode,
      $_mathco, $_cpu, $_cpu_emu, $_rdtsc, $_cpuspeed, $_xms, $_ems, $_ems_frame,
      $_ext_mem, $_dpmi, $_dpmi_base, $_ignore_djgpp_null_derefs, $_emusys,
      $_emuini, $_dosmem, $_full_file_locks, $_lfn_support
    checkuservar
      $_term_char_set, $_term_color, $_term_updfreq, $_escchar, $_layout,
      $_xterm_title, $_rawkeyboard, $_video, $_console, $_graphics,
      $_external_char_set, $_internal_char_set
    checkuservar
      $_X_updfreq, $_X_title, $_X_title_show_appname, $_X_icon_name,
      $_X_keycode, $_X_blinkrate,
      $_X_font, $_X_mitshm, $_X_sharecmap, $_X_fixed_aspect, $_X_aspect_43,
      $_X_lin_filt, $_X_bilin_filt, $_X_mode13fact, $_X_winsize, $_X_gamma,
      $_X_fullscreen, $_X_vgaemu_memsize, $_X_lfb, $_X_pm_interface, $_X_mgrab_key,
      $_X_vesamode, $_X_background_pause
    checkuservar
      $_hdimage,
      $_com1, $_com2, $_com3, $_com4, $_mouse, $_mouse_dev, $_mouse_flags, $_mouse_baud,
      $_printer, $_printer_timeout, $_printer_command, $_printer_commands,
      $_lpt1, $_lpt2, $_lpt3,
      $_ipxsupport, $_ipx_network, $_netdev, $_novell_hack,
      $_sound, $_sb_base, $_sb_irq, $_sb_dma, $_sb_hdma, $_sb_dsp, $_sb_mixer, $_mpu_base,
      $_sound_driver,
      $_oss_min_frags, $_oss_max_frags, $_oss_stalled_frags, $_oss_do_post, $_oss_min_extra_frags,
      $_oss_dac_freq,
      $_joy_device, $_joy_dos_min, $_joy_dos_max, $_joy_granularity, $_joy_latency,
      $_vbootfloppy, $_cdrom, $_aspi
    $xxx = $_vnet
    checkuservar $_vnet
    if ($_vnet ne $xxx && $_vnet ne "tap")
      $_vnet = $xxx
    endif
    $xxx = $_pktdriver
    checkuservar $_pktdriver
    if ($_pktdriver ne $xxx && $_pktdriver && $_vnet ne "tap")
      $_pktdriver = $xxx
    endif
    $xxx = $speaker
    checkuservar $_speaker
    if ($speaker ne $xxx && $speaker eq "native")
      $speaker = $xxx
    endif
  endif
  ## end of .dosemurc inclusion

  if (strlen($_mapping)) $xxx = $_mapping else $xxx = "auto" endif
  mappingdriver $xxx;

  if (strlen($_debug))
    debug $_debug ;
  else
    debug { off }
  endif
  if (strlen($_trace_ports)) trace ports { $$_trace_ports } endif

  cpuspeed $_cpuspeed
  rdtsc $_rdtsc

  dosbanner on
  timer 0
  mathco $_mathco
  $xxx = "cpu ", $_cpu;
  $$xxx
  if (strlen($_cpu_emu))
    $xxx = "cpuemu ", $_cpu_emu;
    $$xxx
  else
    cpuemu off
  endif
  xms 0
  $_pm_dos_api = $_ems;		# disabling EMS disables also the translator
  if ($_ems || ($_dpmi && $_pm_dos_api)) ems { ems_size $_ems ems_frame $_ems_frame } else ems off endif
  dpmi $_dpmi
  dpmi_base $_dpmi_base
  pm_dos_api $_pm_dos_api
  ignore_djgpp_null_derefs $_ignore_djgpp_null_derefs
  dosmem $_dosmem
  if ($_ext_mem)
    ext_mem $_ext_mem
  else
    ext_mem $_xms
  endif

  if ($_emusys ne "") emusys $_emusys endif
  if ($_emuini ne "") emuini $_emuini endif

  ## terminal stuff, we check a lot to insure proper operation

  $BEING_ON = ""
  $USING_X = (0)

  if (strpbrk($DOSEMU_OPTIONS,"SX") >=0)
    $USING_X = (1)
    $BEING_ON = "X"
  else
   if ($DOSEMU_STDIN_IS_CONSOLE eq "1")
    $BEING_ON = "console"
   else
    $BEING_ON = ""
    if (strstr("xterm dtterm", $TERM) >= 0)
      $BEING_ON = $BEING_ON, "_xterm"
    else
      if (strstr("linux console", $TERM) < 0)
        # remote side must be some type of real terminal
        $BEING_ON = $BEING_ON, "_terminal"
      else
        # remote side is a Linux console
        $BEING_ON = $BEING_ON, "_console"
      endif
    endif
   endif
  endif

  warn "dosemu running on ", $BEING_ON;

  terminal { color $_term_color  updatefreq $_term_updfreq  escchar $_escchar }
  xterm_title $_xterm_title
  video { vga }
  if ($_external_char_set ne "")
    charset { external $$_external_char_set }
  endif
  if ($_internal_char_set ne "")
    charset { internal $$_internal_char_set }
  endif

  ## X param settings

  if ( $USING_X || (strchr($DOSEMU_OPTIONS,"L") >0) )
    # running as xdos or DEXE (which may force X later)
    if ($_X_keycode == -1)
      $xxx = "keycode 2"
    else if ($_X_keycode)
      $xxx = "keycode 1"
    else
      $xxx = "keycode 0"
    endif endif
    if ($_X_sharecmap) $xxx = $xxx, " sharecmap" endif
    if ($_X_aspect_43) $xxx = $xxx, " aspect_43" endif
    if ($_X_lin_filt) $xxx = $xxx, " lin_filt"  endif
    if ($_X_bilin_filt) $xxx = $xxx, " bilin_filt" endif
    $xxx = $xxx, " mode13fact ", $_X_mode13fact
    $xxx = $xxx, " gamma ", (int($_X_gamma * 100))
    $xxx = $xxx, " font '", $_X_font, "'"
    if (strlen($_X_winsize))
      $yyy = (strstr($_X_winsize,","))
      $yyy = " winsize (", strdel($_X_winsize,$yyy,999), ") , (",
              strsplit($_X_winsize,$yyy+1,999), ")"
      $xxx = $xxx, $yyy
    endif

    if (strlen($_X_vesamode))
      foreach $yyy (" 	", $_X_vesamode)
        $zzz = (strchr($yyy,","))
        $xxx = $xxx, " vesamode (", strdel($yyy,$zzz,999), "),(",
                      strsplit($yyy,$zzz+1,999), ") "
      done
    endif
    $xxx = $xxx, ' mgrab_key "', $_X_mgrab_key, '"'
    warn "x ", $xxx
    X { 
      title $_X_title title_show_appname $_X_title_show_appname      
      icon_name $_X_icon_name
      updatelines 25 updatefreq $_X_updfreq blinkrate $_X_blinkrate
      fixed_aspect $_X_fixed_aspect vgaemu_memsize $_X_vgaemu_memsize
      lfb $_X_lfb  pm_interface $_X_pm_interface mitshm $_X_mitshm
      background_pause $_X_background_pause fullscreen $_X_fullscreen $$xxx
    }
  endif

  # video settings
  if ($BEING_ON eq "console")
    $xxx = $_video
    if ($_console) $xxx = $xxx, " console" endif
    if ($_graphics) $xxx = $xxx, " graphics" endif
    $xxx = $xxx, " vbios_seg ", $_vbios_seg, " vbios_size ",
	        $_vbios_size, " memsize ", $_vmemsize
    if (strlen($_chipset)) $yyy = $_chipset else $yyy = "plainvga" endif
    $xxx = $xxx, " chipset ", $yyy
    if ($_vbios_post) $xxx = $xxx, " vbios_post " endif
    if ($_dualmon) $xxx = $xxx, " dualmon" endif
    if (strlen($_vbios_file)) $xxx = $xxx, " vgaemubios_file ", $_vbios_file endif
    video { $$xxx }
  else
    $xxx = $_video
    if (strlen($_vbios_file)) $xxx = $xxx, " vgaemubios_file ", $_vbios_file endif
    if ($_dualmon) $xxx = $xxx, " dualmon " endif
    if (strlen($xxx)) video { $$xxx } endif
  endif

  ## sound settings
  if ($_sound)
    sound_emu { sb_base $_sb_base
	        sb_irq $_sb_irq
		sb_dma $_sb_dma
		sb_hdma $_sb_hdma
	        sb_mixer $_sb_mixer
		sb_dsp $_sb_dsp
		mpu_base $_mpu_base
		sound_driver "oss"
	      }
    sound_emu $_sound
    oss_options { oss_min_frags $_oss_min_frags
		  oss_max_frags $_oss_max_frags
		  oss_stalled_frags $_oss_stalled_frags
		  oss_do_post $_oss_do_post
		  oss_min_extra_frags $_oss_min_extra_frags
		  oss_dac_freq $_oss_dac_freq
		}
  else
    sound_emu off
  endif

  ## joystick settings
  joystick_emu { joy_device $_joy_device joy_dos_min $_joy_dos_min
	joy_dos_max $_joy_dos_max joy_granularity $_joy_granularity
	joy_latency $_joy_latency }

  ## hacks
  cli_timeout $_cli_timeout
  pic_watchdog $_pic_watchdog
  timemode $_timemode

  full_file_locks $_full_file_locks
  lfn_support $_lfn_support

  ## serial
  $xxx = "'", $_ttylocks, "'"
  ttylocks { directory $$xxx namestub LCK.. }
  if (1) # no idea why but we need this...
    foreach $xxx (" ", "1 2 3 4")
      $yyy = "com", $xxx
      $zzz = "$_com", $xxx
      $zzz = $$zzz
      if (strlen($zzz))
        if ($_mouse_dev eq $yyy)
          serial { mouse com $xxx device $$zzz }
	  if ($_mouse_internal)
	    mouse { internaldriver }
	  endif
          $_mouse = ""
        else
          if ($zzz eq "virtual")
            serial { com $xxx virtual }
          else
            serial { com $xxx device $$zzz }
          endif
        endif
      endif
    done
  endif

  ## mouse settings
  if ($_mouse_internal && (strstr($_mouse_dev,"com")<0))
    $xxx = ""
    if ($_mouse_baud)
      $xxx = "baudrate ", $_mouse_baud
    endif
    $xxx = $xxx, " device '", $_mouse_dev, "'"
    mouse { $$_mouse $$_mouse_flags $$xxx internaldriver }
  endif

  hogthreshold $_hogthreshold

  ## keyboard setting
  if ($BEING_ON ne "console") $_rawkeyboard = (off) endif
  if ($_layout eq "auto")
    keyboard { layout auto  rawkeyboard $_rawkeyboard }
  else
    if ( strstr($_layout, "load") <0 )
      # we use the builtin keytables
      if (strlen($_layout)) $yyy = $_layout else $yyy = "us" endif
      keyboard { layout $$yyy  rawkeyboard $_rawkeyboard }
    else
      # we have to load a keytable
      $yyy = ""
      if (1) # no idea why (see com as well) but we need this...
        foreach $zzz ($LIST_DELIM, $_layout)
          if ($zzz ne "load")
            $yyy = $zzz
          endif
        done
      endif
      if (!strlen($yyy))
        abort "no keytable name in $_layout"
      endif
      shell("test -f ", $DOSEMU_LIB_DIR, "/keymap/", $yyy)
      if ( $DOSEMU_SHELL_RETURN)
        abort "keytable ",$yyy, "not found in ", $DOSEMU_LIB_DIR, "/keymap/*"
	      endif
      $_layout = 'include "keymap/', $yyy, '"' ;
      $$_layout
      keyboard { rawkeyboard $_rawkeyboard }
    endif
  endif

  $_disks = $_hdimage
  dexe { allowdisk }
  if (!strlen($_vbootfloppy))
    bootC                      # default boot mode is 'from C:'
  else
    bootA                      # default boot mode is 'from A:'
    $yyy = ""; $zzz = "";
    if (strlen($_vbootfloppy))
      foreach $xxx ($LIST_DELIM, $_vbootfloppy)
        if (strlen($yyy))
          $zzz = $xxx
        else
          $yyy = $xxx
        endif
      done
    endif
    if (strchr($yyy, "/") != 0)
      $yyyy = $HOME, "/.dosemu/", $yyy
      shell("test -f '", $yyyy, "'")
      if ($DOSEMU_SHELL_RETURN)
        $yyyy = $DOSEMU_CONF_DIR, "/", $yyy
      endif
      shell("test -f '", $yyyy, "'")
      if ($DOSEMU_SHELL_RETURN)
        $yyyy = $DOSEMU_HDIMAGE_DIR, "/", $yyy
      endif
      $yyy = $yyyy
    endif
    $_vbootfloppy = $yyy
    shell("test -d '", $yyy, "'")
    if ($DOSEMU_SHELL_RETURN)
      bootdisk { heads 2  sectors 18  tracks 80  threeinch file $_vbootfloppy }
    else
      bootdisk { threeinch directory $_vbootfloppy readonly }
    endif
    if (strlen($zzz))
      $_disks = $_hdimage
    endif
  endif
  if (strlen($_floppy_a))
    $zzz = strsplit($_floppy_a, strstr($_floppy_a, ":"), 999);
    if (strlen($zzz))
      $zzz = strsplit($zzz, 1, 999)
      $_floppy_a = strdel($_floppy_a, strstr($_floppy_a, ":"), 999);
    else
      $zzz = "/dev/fd0"
    endif
    $xxx = shell("test -r ", $zzz);
    if ($DOSEMU_SHELL_RETURN)
      warn "**** Warning: floppy ", $zzz, " not accessible, disabled";
    else
      shell("test -d '", $zzz, "'")
      if ($DOSEMU_SHELL_RETURN)
        floppy { device $$zzz $$_floppy_a }
      else
        floppy { directory $$zzz $$_floppy_a }
      endif
    endif
  endif
  if (strlen($_floppy_b))
    $zzz = strsplit($_floppy_b, strstr($_floppy_b, ":"), 999);
    if (strlen($zzz))
      $zzz = strsplit($zzz, 1, 999)
      $_floppy_b = strdel($_floppy_b, strstr($_floppy_b, ":"), 999);
    else
      $zzz = "/dev/fd1"
    endif
    $xxx = shell("test -r ", $zzz);
    if ($DOSEMU_SHELL_RETURN)
      warn "**** Warning: floppy ", $zzz, " not accessible, disabled";
    else
      shell("test -d '", $zzz, "'")
      if ($DOSEMU_SHELL_RETURN)
        floppy { device $$zzz $$_floppy_b }
      else
        floppy { directory $$zzz $$_floppy_a }
      endif
    endif
  endif
  fastfloppy 1

  ipxsupport $_ipxsupport
  ipx_network $_ipx_network
  novell_hack $_novell_hack
  if (strlen($_printer) || strlen($_printer_command))
    # backward compatibility
    if (!strlen($_printer))
      $_printer_commands = $_printer_command
    else
      if (!strlen($_printer_command))
        $_printer_command = "lpr"
      endif
      $_printer_commands = ""
      foreach $xxx ($LIST_DELIM, $_printer)
        $_printer_commands = $_printer_commands, $_printer_command, " -P", $xxx, ","
      done
    endif
  endif
  if (strlen($_printer_commands))
    foreach $xxx (",", $_printer_commands)
      $xxx = "'", strdel($xxx, 0, strspn($xxx, $LIST_DELIM)), "'"
      printer { command $$xxx timeout $_printer_timeout }
    done
  endif
  if (1) # no idea why but we need this...
    foreach $xxx (" ", "1 2 3")
      $yyy = "lpt", $xxx
      $zzz = "$_lpt", $xxx
      $zzz = $$zzz
      if (strlen($zzz))
        $zzz = "'", $zzz, "'"
        printer { lpt $xxx command $$zzz timeout $_printer_timeout }
      endif
    done
  endif

  if (strlen($_speaker))
    $xxx = "speaker ", $_speaker;
    $$xxx
  else
    speaker off
  endif
  ifdef restricted
    ## /etc/dosemu.users defined 'restricted' for this login
    define c_normal
    undef c_all
    if ($_vnet eq "tap" || !$_pktdriver)
      netdev $_netdev
      vnet $_vnet
      pktdriver $_pktdriver
    endif
    if ($_pci)
      pci auto
    endif
  else
    # here are the root requiring options
    if (strlen($_irqpassing))
      $yyy = "irqpassing { "
      if (strlen($_irqpassing))
        foreach $xxx (" ", $_irqpassing)
          $yyy = $yyy, "use_sigio ", $xxx
        done
      endif
      $yyy = $yyy, " }";
      $$yyy
    else
      irqpassing off
    endif
    if (strlen($_hardware_ram))
      hardware_ram { $$_hardware_ram }
    endif
    netdev $_netdev
    vnet $_vnet
    pktdriver $_pktdriver
    if (strlen($_ports)) ports { $$_ports } endif
    pci $_pci
  endif

  ## setting up hdimages
  if (strlen($_disks) && (!defined(c_dexerun)))
    $yyy = strsplit($_disks, 0, strpbrk($_disks, $LIST_DELIM) + 1)
    if (strlen($_disks))
     foreach $xxxx ($LIST_DELIM, $_disks)
      $xxx_pref = ""
      if ((strchr($xxxx, "*") + 1) && (strlen($xxxx) == strchr($xxxx, "*") + 1))
        $xxx_pref = strdel($xxxx, strlen($xxxx) - 1, 1);
        if (strchr($xxx_pref, "/") == 0)
          $xxxx = shell("cd '", $xxx_pref, "' 2>/dev/null && echo -n *")
        else
          $xxxx = shell("cd '", $HOME, "/.dosemu/", $xxx_pref, "' 2>/dev/null && echo -n *")
          if ($DOSEMU_SHELL_RETURN || $xxxx eq "*")
            $xxxx = shell("cd '", $DOSEMU_CONF_DIR, "/", $xxx_pref, "' 2>/dev/null && echo -n *")
          endif
          if ($DOSEMU_SHELL_RETURN || $xxxx eq "*")
            $xxxx = shell("cd '", $DOSEMU_HDIMAGE_DIR, "/", $xxx_pref, "' 2>/dev/null && echo -n *")
          endif
        endif
        if ($DOSEMU_SHELL_RETURN)
          $xxxx = strcat($xxx_pref, "*")
          $xxx_pref = ""
        endif
      endif
     if (strlen($xxxx))
     foreach $xxx ($LIST_DELIM, $xxxx)
      $xxx = strcat($xxx_pref, $xxx)
      if (!strncmp($xxx, "/dev/", 4))
        $yyy = strdel($xxx, strstr($xxx, ":ro"), 999);
        $zzz = strsplit($xxx, strstr($xxx, ":ro"), 999);
        if (strtol(strdel($xxx,0,8)) > 0)
          $yyy = "disk { partition ", $yyy;
        else
          $yyy = "disk { wholedisk ", $yyy;
        endif
        if (strlen($zzz))
          $yyy = $yyy, " readonly"
        endif
        $yyy = $yyy, " }";
        $$yyy;
      else
        $yyy = strdel($xxx, strstr($xxx, ":ro"), 999);
        $zzz = strsplit($xxx, strstr($xxx, ":ro"), 999);
        if (strchr($yyy, "/") != 0)
          $yyyy = $HOME, "/.dosemu/", $yyy
          shell("test -e '", $yyyy, "'")
          if ($DOSEMU_SHELL_RETURN)
            $yyyy = $DOSEMU_CONF_DIR, "/", $yyy
	  endif
          shell("test -e '", $yyyy, "'")
          if ($DOSEMU_SHELL_RETURN)
            $yyyy = $DOSEMU_HDIMAGE_DIR, "/", $yyy
	  endif
	  $yyy = $yyyy
        endif
        shell("test -d '", $yyy, "'")
        if (!$DOSEMU_SHELL_RETURN)
          if (strlen($zzz))
            disk { directory $yyy readonly };
          else
            disk { directory $yyy };
          endif
        else
          disk { image $yyy }
        endif
      endif
     done
     endif
    done
   endif
  endif

  ## setting up CDROM devices
  if (strlen($_cdrom))
    foreach $xxx ($LIST_DELIM, $_cdrom)
      cdrom { $xxx }
    done
  endif

  ## setting up ASPI devices
  ifndef restricted
    if (strlen($_aspi))
      foreach $xxx ($LIST_DELIM, $_aspi)
        $zz = (1);
        $yy2 = ""; $yy3 = (-1);
        if(strlen($xxx))
         foreach $yyy (":", $xxx)
          $zzz = "$yy", $zz, " = $yyy";
          $zz = ($zz + 1);
          $$zzz
         done;
        endif;
        aspi { $yy1 devicetype $yy2 target $yy3 };
      done
    endif
  endif

  ## setting up the features list
  if ( (  ($DOSEMU_VERSION_CODE >= ((98 << 16) | (3 << 8) | 3))
             && ($DOSEMU_VERSION_CODE < (99 << 16)) )
       || ($DOSEMU_VERSION_CODE > ((99 << 16) | (5 << 8))) )
    if (strlen($_features))
      foreach $xxx ($LIST_DELIM, $_features)
        $yyy = strdel($xxx, strstr($xxx, ":"), 999);
        $zzz = strsplit($xxx, strstr($xxx, ":"), 999);
        if (strlen($zzz))
          $zzz = strsplit($zzz, 1, 999);
        else
          $zzz = (0);
        endif
        feature { $yyy = $zzz };
      done
    endif
  endif

endif
#############################################################################