home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / UTILS / S / UZI.ARK / DEVMISC.C < prev    next >
Text File  |  1988-11-30  |  1KB  |  88 lines

  1. /**************************************************
  2. UZI (Unix Z80 Implementation) Kernel:  devmisc.c
  3. ***************************************************/
  4.  
  5.  
  6. #include "unix.h"
  7. #include "extern.h"
  8.  
  9. mem_read(minor, rawflag)
  10. int minor;
  11. int rawflag;
  12. {
  13.     bcopy((char *)(512*udata.u_offset.o_blkno+udata.u_offset.o_offset),
  14.                  udata.u_base, udata.u_count);
  15.     return(udata.u_count);
  16. }
  17.  
  18. mem_write(minor, rawflag)
  19. int minor;
  20. int rawflag;
  21. {
  22.     bcopy(udata.u_base,
  23.         (char *)(512*udata.u_offset.o_blkno+udata.u_offset.o_offset),
  24.                 udata.u_count);
  25.     return(udata.u_count);
  26. }
  27.  
  28.  
  29.  
  30. null_write(minor, rawflag)
  31. int minor;
  32. int rawflag;
  33. {
  34.     return(udata.u_count);
  35. }
  36.  
  37.  
  38.  
  39. static char lop = 0;
  40.  
  41. lpr_open()
  42. {
  43.     lop = 1;
  44.     return(0);
  45. }
  46.  
  47. lpr_close()
  48. {
  49.     if (lop)
  50.     {
  51.         lop  = 0;
  52.         lpout('\f');
  53.         lpout('\f');
  54.     }
  55.     return(0);
  56. }
  57.  
  58.  
  59.  
  60. lpr_write(minor, rawflag)
  61. int minor;
  62. int rawflag;
  63. {
  64.     unsigned n;
  65.  
  66.     n = udata.u_count;
  67.     while (n--)
  68.         lpout(*udata.u_base++);
  69.     return(udata.u_count);
  70. }
  71.  
  72.  
  73. lpout(c)
  74. char c;
  75. {
  76.     while(in(0x84)&02)
  77.         ;
  78.  
  79.     out(c,0x85);
  80.     out(0xfe,0x86);
  81.     out(0xff,0x86);
  82.     out(0xff,0x85);
  83. }
  84.  
  85.  
  86. #include "devmt.c"
  87.  
  88.