Blu-ray discs

Disc Manufacture ID list

BD Writing time

writer
speed
one layer
(minutes)
dual layer
(minutes)
1x90180
2x4590
4x2345
6x1530
8x1223
12x0815
ref: https://pt.wikipedia.org/wiki/Disco_Blu-ray

trivia: Disk or disc?

CGO inside Windows

What is CGO?

CGO lets Go packages call C code

Installing MSYS2

  • Download installer from https://www.msys2.org/ (current it’s msys2-x86_64-20200903.exe)
  • After install, inside MSYS terminal, using pacman, install gcc
pacman -S \
 mingw-w64-x86_64-binutils \
 mingw-w64-x86_64-crt-git \
 mingw-w64-x86_64-gcc \
 mingw-w64-x86_64-gcc-libs \
 mingw-w64-x86_64-gdb  \
 mingw-w64-x86_64-headers-git \
 mingw-w64-x86_64-libmangle-git   \
 mingw-w64-x86_64-libwinpthread-git \
 mingw-w64-x86_64-make \
 mingw-w64-x86_64-pkg-config \
 mingw-w64-x86_64-tools-git \
 mingw-w64-x86_64-winpthreads-git \
 mingw-w64-x86_64-winstorecompat-git 
  • now, configure bash initialization
# inside: ~/.bashrc

alias ll="ls -la --color"

export PATH=/s/go/bin:$PATH
export GOPATH=/w/work/go

Configure Windows Terminal

As explained in official guide…

{
 "guid": "{17da3cac-b318-431e-8a3e-7fcdefe6d114}",
 "name": "MINGW64 / MSYS2",
 "commandline": "S:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw64",
 //"startingDirectory": "C:/msys64/home/%USERNAME%",
 "startingDirectory": "W:/work",
 "icon": "S:/msys64/mingw64.ico",
 "fontSize": 12,
 "colorScheme": "GitBash"
},
{
 "guid": "{2d51fdc4-a03b-4efe-81bc-722b7f6f3820}",
 "name": "MINGW32 / MSYS2",
 "commandline": "S:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw32",
 // "startingDirectory": "C:/msys64/home/%USERNAME%",
 "startingDirectory": "W:/work",
 "icon": "S:/msys64/mingw32.ico",
 "fontFace": "Lucida Console",
 "fontSize": 12
},
{
 "guid": "{71160544-14d8-4194-af25-d05feeac7233}",
 "name": "MSYS / MSYS2",
 "commandline": "S:/msys64/msys2_shell.cmd -defterm -here -no-start -msys",
 // "startingDirectory": "C:/msys64/home/%USERNAME%",
 "startingDirectory": "W:/work",
 "icon": "S:/msys64/msys2.ico",
 "fontFace": "Lucida Console",
 "fontSize": 14
}

Testing

cd $GOPATH
go get github.com/mattn/go-sqlite3
go install github.com/mattn/go-sqlite3

Windows Terminal Git Bash

How to add Git Bash into Windows Terminal

Inside Windows Terminal, press CTRL+, to start editing “settings.json”

{
   "profiles": {
      "list": [
         {
            "guid": "{f9c3b687-50b7-4b13-b312-c28e955ed7d3}",
            "hidden": false,
            "name": "Git Bash",
            "commandline": "S:/app/Git/usr/bin/bash.exe -i -l",
            "startingDirectory": "W:/work",
            "icon": "S:/app/Git/mingw64/share/git/git-for-windows.ico",
            "snapOnInput": true,
            "closeOnExit": true,
            "colorScheme": "GitBash",
            "fontFace": "Consolas",
            "fontSize": 14
         }
      ]
   }
}

After this, add a custom color scheme named “GitBash”

"schemes": [
   {
      "name": "GitBash",
      "background": "#FFFFF0",
      "foreground": "#404040",
      "black": "#0C0C0C",
      "blue": "#6060ff",
      "brightBlack": "#767676",
      "brightBlue": "#3B78FF",
      "brightCyan": "#61D6D6",
      "brightGreen": "#16C60C",
      "brightPurple": "#B4009E",
      "brightRed": "#E74856",
      "brightWhite": "#F2F2F2",
      "brightYellow": "#F9F1A5",
      "cyan": "#3A96DD",
      "green": "#00a400",
      "purple": "#bf00bf",
      "red": "#bf0000",
      "white": "#ffffff",
      "yellow": "#bfbf00",
      "grey": "#bfbfbf"
   }
],

REFERENCES

https://stackoverflow.com/questions/56839307/adding-git-bash-to-the-new-windows-terminal

Windows 10 permissions

RunAs Administrator:

REM Backup permissions of WindowsApps
icacls "%ProgramFiles%\WindowsApps" /save WindowsApps.acl

REM change owner to copy directory (it's a LOT of files!!!)
takeown /F “C:\Program Files\WindowsApps” /A /R

robocopy "c:\Program Files" s:\C_ProgramFiles /COPYALL /MIR /LOG:robocopy.txt /ZB /DCOPY:T /V /TEE

REM restore permissions
icacls "%ProgramFiles%" /restore WindowsApps.acl
RunAs Administrator:

cd some_directory
icacls * /t /q /c /reset
takeown /R /F *
icacls * /t /grant Everyone:F
cd ..
REM List all symbolic links and directory junctions
DIR /AL /S C:\

Junctions vs Directory symbolic link

https://superuser.com/questions/343074/directory-junction-vs-directory-symbolic-link

icacls reference

Windows 10 reset NTFS permissions

RunAs Administrator:

cd some_directory
icacls * /t /q /c /reset
takeown /R /F *
icacls * /t /grant Everyone:F
cd ..
REM to save and restore permissions
icacls _directory_ /save _filename_
icacls _directory_ /restore _filename_


REM Backup permissions of WindowsApps
icacls "%ProgramFiles%\WindowsApps" /save WindowsApps.acl /t

REM restore permissions
icacls "%ProgramFiles%" /restore WindowsApps.acl

Reference: icacls reference

MSX RS232C BIOS Call spec

Mirror from: http://www.msxarchive.nl/pub/msx/mirrors/msx2.com/sources/232bcal.txt

   RS232C Extended BIOS Call specification

                                September 18th, 1984
                                December  24th, 1985








































RS232C Extended BIOS Call specification                         Page 2


1.0  GENERAL DESCRIPTION

        The  RS232C  driver  can be  used by  application programs  using the
        "EXTENDED BIOS CALL" mechanism. Such user can access each function in
        the  RS232C driver  through the entry jump table with inter-slot call
        funtion provided  in the  BIOS. The user is able to know the location
        of  this table  by EXTENDED  BIOS CALL 0 and 1. Refer to the document
        "Specification of the EXTENDED BIOS CALL" for details.




1.1  EXTENDED BIOS CALL ENTRY TABLE

        The RS232C  driver has  entries as  follows. A application program is
        able to use RS232C driver by 'inter-slot call' to those entries.

For I/O port only type of RS-232C interface.

EXBTBL: DEFB    DVINFB          ; device information
        DEFB    0               ; reserved for future expansion
        DEFB    0
        JP      INIT            ; initialize RS232C port
        JP      OPEN            ; Open RS232C port
        JP      STAT            ; ReaD STATus
        JP      GETCHR          ; receive data
        JP      SNDCHR          ; send data
        JP      CLOSE           ; close RS232C port
        JP      EOF             ; tell EOF code received
        JP      LOC             ; reports number of characters in the
                                ; receiver buffer
        JP      LOF             ; reports number of free space left in
                                ; receiver buffer
        JP      BACKUP          ; back up a character
        JP      SNDBRK          ; send a break character
        JP      DTR             ; turn on/off DTR line
        NOENT
        NOENT
        NOENT
























RS232C Extended BIOS Call specification                         Page 3



Multi channel type RS-232C cartridge

EXBTBL:
        DEFB    DVINFB
        DEFB    1               ; version number
        DEFB    0               ; reserved for future expansion
        JP      INIT            ; initialize RS232C port
        JP      OPEN            ; open RS232C port
        JP      STAT            ; ReaD STATus
        JP      GETCHR          ; reveive data
        JP      SNDCHR          ; send data
        JP      CLOSE           ; close RS232C port
        JP      EOF             ; tell EOF code received
        JP      LOC             ; reports number of characters in the
                                ; receiver buffer
        JP      LOF             ; reports number of free space left in the
                                ; receiver buffer
        JP      BACKUP          ; back up a character
        JP      SNDBRK          ; send break character
        JP      DTR             ; turn on/off DTR line
        JP      SETCHN          ; set channel number
        NOENT
        NOENT



                                NOTE

                The  RS232C  receiver  is  driven  by the
                interrupt  generated  by  receiver ready.
                However,   the  inter-slot  call  handler
                disables  interrupt   automatically.  So,
                when  control returns to  the application
                program,  it has  to enable  interrupt as
                soon  as   possible.   Otherwise,  RS232C
                receiver    routine    loses     incoming
                characters.

























RS232C Extended BIOS Call specification                         Page 4



2.0  DESCRIPTION OF EACH EXTENDED BIOS CALL

2.1  Initialize RS232C Port (INIT)


        Entry:  [HL]= address of the parameter table
                [B] = slot address of the parameter table
        Return: carry flag is set if illegal parameters are contained
        Modify: [AF]

        Description:
         To initialize  the RS232C  port with specified parameter. This entry
         must  be  called  before  any  other  function  calls are  made. The
         parameters  are  similar  to  _COMINI  expanded statement  of BASIC.
         However,  note that  all the ascii parameters must be specified with
         upper case characters only.

        BAUD RATE
         It  is  possible  to  set different  baud rate  for transmitter  and
         receiver. The possible value for the baud rate are as follows:

         50, 75, 110, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800,
         7200, 9600, 19200

         When negative  value is  specified, its absolute value is written to
         i8253 timer/counter directly.


        TIME OUT
         The  RS232C  driver waits  till the  CTS (Clear  To Send)  signal is
         turned  on and/or  XON is received when the character is to be sent.
         The driver  will generates time out error when it waits for them, if
         specified  time passed.  Its time is specified this value at second.
         If 0  specified then  the driver doesn't generate time out error and
         waits forever.



























RS232C Extended BIOS Call specification                         Page 5



                +-------------------------------+
    [B]:[HL]--> | Character length '5'-'8'      |\
                +-------------------------------+ \
                | Parity 'E','O','I','N'        |  |
                +-------------------------------+  |
                | Stop bits '1','2','3'         |  |
                +-------------------------------+   >-- ASCII
                | XON/XOFF controll 'X','N'     |  |   character
                +-------------------------------+  |
                | CTR-RTS hand shake 'H','N'    |  |
                +-------------------------------+  |
                | Auto LF for receive 'A','N'   |  |
                +-------------------------------+  |
                | Auto LF for send 'A','N'      |  |
                +-------------------------------+ /
                | SI/SO control 'S','N'         |/
                +-------------------------------+
                | Receiver baud rate    (low)   |\
                +---                        ----+ \
                | 50-19200              (high)  |  |
                +-------------------------------+  |
                | Transmitter baud rate (low)   |   >-- Binary
                +---                        ----+  |
                | 50-19200              (high)  |  |
                +-------------------------------+ /
                | Time out counter 0-255        |/
                +-------------------------------+



































RS232C Extended BIOS Call specification                         Page 6



2.2  Open RS232C Port (OPEN)

        Entry:  [HL]= address of FCB (must be located higher address
                      than 8000H)
                [C] = buffer length ( 32-254 )
                [E] = open mode, one of following:
                 +----------+------------------------------+
                 |open mode |   meanings                   |
                 +----------+------------------------------+
                 |    1     |  mode                 |
                 |    2     |  mode                |
                 |    4     |  and  mode|
                 +----------+------------------------------+
        Return: carry flag is set if any error occured.
        Modify: [AF]

        Description:
         Opens  RS232C port  with specified  FCB (File  Control Block). Opens
         must be  made before  any I/O  operations take  place. Each received
         character  occupies  two  bytes  in  the  buffer.  One  is  received
         character  code itself  and another  is error status of the received
         character. And  extra 9 bytes are necessary as a working storage for
         the  file  control.  Note  that  the  buffer  length  passed  by [C]
         specifies  number of  characters, so  the actual length of buffer is
         [C] x 2 + 9 bytes. And this buffer area can be accessed without slot
         handling whenever  the RS232C driver is called (including the timing
         when the interrupt from the the receiver generated).

                |                               |
                +-------------------------------+
                | 9 bytes for file control      |
                |                               |
                +-------------------------------+
                | [C] x 2 bytes receiver buffer |
                |                               |
                +-------------------------------+
                |                               |

























RS232C Extended BIOS Call specification                         Page 7



2.3  Read Status (STAT)

        Entry:  None
        Return: [HL]= status data.
        Modify: None

        Description:
         Returns  various status  information and error code of the character
         just read from the buffer (not the character just received).
    +---------+-------------------------------------------------+
    | BIT NO. |       Description                               |
    +---------+-------------------------------------------------+
    |   15    | Buffer over flow error                          |
    |         |   0 - no buffer over flow                       |
    |         |   1 - buffer over flow                          |
    |   14    | Time out error                                  |
    |         |   0 - no time out error occured                 |
    |         |   1 - time out error occured                    |
    |   13    | Framing error                                   |
    |         |   0 - no framing error occured                  |
    |         |   1 - framing error occured                     |
    |   12    | Over run error                                  |
    |         |   0 - no over run error occured                 |
    |         |   1 - over run error occured                    |
    |   11    | Parity error                                    |
    |         |   0 - the character hasn't parity error         |
    |         |   1 - the character has parity error            |
    |   10    | Control break key was pressed                   |
    |         |   0 - control break key wasn't pressed          |
    |         |   1 - control break key was pressed             |
    |    9    | Not used, reserved                              |
    |    8    | Not used, reserved                              |
    |    7    | Clear To Send                                   |
    |         |   0 - false                                     |
    |         |   1 - true                                      |
    |    6    | Timer/counter output-2                          |
    |         |   0 - timer/counter output-2 is negated         |
    |         |   1 - timer/counter output-2 is asserted        |
    |    5    | Not used, reserved                              |
    |    4    | Not used, reserved                              |
    |    3    | Data Set Ready                                  |
    |         |   0 - false                                     |
    |         |   1 - true                                      |
    |    2    | break detect                                    |
    |         |   0 - not yet detect                            |
    |         |   1 - detect                                    |
    |    1    | Ring Indicator                                  |
    |         |   0 - false                                     |
    |         |   1 - true                                      |
    |    0    | Carrier Detect                                  |
    |         |   0 - false                                     |
    |         |   1 - true                                      |
    +---------+-------------------------------------------------+









RS232C Extended BIOS Call specification                         Page 8



2.4  Get A Character From The Receive Buffer (GETCHR)

        Entry:  None
        Return: [A] = character received
                sign flag is set if any error occured.
                carry flag  is set  if the character is an EOF code when port
                is opened for input mode.
        Modify: [F]

        Description:
         Get  a  character  from  the  receiver  buffer.  Returns  backed  up
         character if any.




2.5  Send A Character To The RS232C Port (SNDCHR)

        Entry:  [A] = character to send
        Return: carry flag is set if control break key was pressed
                zero flag is set if time out error occured during waiting for
                XON or/and CTS signal.
        Modify: [F]

        Description:
         Send  specified character to RS232C port. The character flow control
         by XON/XOFF  characters and/or  CTS (Clear  To Send)  line signal is
         handled  if initialized  so. Time  out error  will be generated when
         specified time passed during waiting for permision for transmission,
         and the character will not be sent.




2.6  Close The RS232C Port (CLOSE)

        Entry:  None
        Return: carry is set if any error occured
        Modify: [AF]

        Description:
         Closes the  RS232C port.  The buffer  is released, and a EOF code is
         sent  if the port was opened for  mode. RTS signal is turned
         to inactive state.


















RS232C Extended BIOS Call specification                         Page 9



2.7  Check For The EOF Code (EOF)

        Entry:  None
        Return: [HL]= -1, carry flag is set, if the next character is EOF
                      code.
                    =  0, carry flag is reset, if the next character is not
                      EOF code.
        Modify: [AF]

        Description:
         Tests whether the next character is EOF code or not. Returns 0 if no
         character.



2.8  Returns A Number Of Character In The Receive Buffer (LOC)

        Entry:  None
        Return: [HL] = number of character in the receiver buffer
        Modify: [AF]

        Description:
         Returns  number of valid character in the receive buffer. This value
         includes number  of backed  up character.  Characters after EOF code
         are  ignored if  opened in   mode,  but occupies buffer space
         although.



2.9  Returns Number Of Free Space In The Receive Buffer (LOF)

        Entry:  None
        Return: [HL] = number of free space
        Modify: [AF]

        Description:
         Returns a number of free space in character in the receiver buffer.



2.10  Back Up A Character (BACKUP)

        Entry:  [C] = character to back up
        Return: None
        Modify: [F]

        Description:
         Backs up a character in the special buffer. Last backed up character
         will be lost if any.













RS232C Extended BIOS Call specification                         Page 10




2.11  Send Break Character (SNDBRK)

        Entry:  [DE] = number of break character to send
        Return: carry flag is set if control break key was pressed
        Modify: [AF], [DE]

        Description:
         Transmit   specified   number   of   break  characters.   Aborts  if
         Control-Break key  is pressed  during the  transmission and  returns
         with carry flag set.



2.12  Turn On/off DTR Line (DTR)

        Entry:  [A] = 0 if turn off
                [A] = not 0 if turn on
        Return: None
        Modify: [F]

        Description:
         DTR  (Data Terminal  Ready) line  is turned  on when  power-on/reset
         initializing or INIT routine is called.



3.0  MULTIPLE CHANNEL TYPE RS-232C CARTRIDGE

3.1  Set Channel Number (SETCHN)

        Entry:  [A] = channel number.
        Return: Carry  flag is  set if  the channel  is not in the cartridge.
                Otherwise the channel is in the cartridge.
        Modify: [AF], [BC]

        Description:
         The channel number is set with 0 when power-on/reset initializing.
























RS232C Extended BIOS Call specification                         Page 11







                                APPENDIX A

                        MISCELLANEOUS INFORMATIONS




A.1  THE BEHAVIOR OF CONTROL SIGNALS

                RESET        COMINI       OPEN        CLOSE
        ---------------------------------------------------------
         RTS - inactive    no effect     active      inactive
         DTR - active        active     no effect   no effect

RTS signal is affected in following cases:

  1. OPEN statement is executed - activated.
  2. CLOSE statement is executed - inactivated.
  3. The  rest  of the  communication buffer is less than 16 byte and CTS-RTS
     handshake is enabled - inactivated.
  4. When  it is  inactive and  the rest  of the communication buffer becomes
     more than byte and CTS-RTS handshake is enabled - activated.

DTR signal is affected by CALL COMDTR and CALL COMINI statements.



A.2  HANDLING OF EOF

EOF is transmitted when close is executed when the open mode was output.