Writing FCode 2.x Programs
  Search only this book
Download this book in PDF

............................Contents


Preface
xv
...Ordering Sun Documents xviii

1. SBus Cards and FCode
1
...FCode PROM Format 2
...Interpreting FCode 2
...Device Identification 2
...Creating and Executing FCode Definitions 3

2. Elements of FCode Programming
5
...Colon Definitions 6
...Stack Operations 7
...Additional Information 8
...Programming Style 8
......Commenting Code 8
......Short Definitions 9
......Stack Comments 9
... A Minimum FCode Program 10
... FCode Classes 11
...Primitive FCodes 12
...System FCodes 12
...Interface FCodes 13
...Local FCodes 13

3. Producing FCode
15
...FCode Source 15
...Tokenizing FCode Source 16
...FCode Binary Format 17
...Testing FCode on the Target Machine 17
...Configuring the Target Machine 18
......Setting Appropriate Configuration Parameters 18
......Modifying The Expansion Bus Probe Sequence 19
......Getting to the Forth Monitor 20
...Using the Forth Monitor to Download FCode 20
......Using dload to Load from Ethernet 21
......Using dlbin to Load From Serial Port A 21
......Using boot to Load From Hard Disk, Floppy Disk, or Ethernet
...................................................22
...Using the Forth Monitor to Interpret an FCode Program 22
......Interpretation Under OpenBoot 2 23
......Interpretation Under OpenBoot 1 25
...Using the Forth Monitor to Browse a Device Node 26
......Device Node Browsing Under OpenBoot 2 27
......Device Node Browsing Under OpenBoot 1 28
...Using the Forth Monitor to Test a Device Node Driver 29
......Device Node Methods Under OpenBoot 2 29
......Device Node Methods Under OpenBoot 1 32
...Testing FCode in Source Form 32
...Producing an FCode PROM 33
...Exercising an Installed FCode PROM 33
......Exercising FCode Under OpenBoot 2 34
......Exercising FCode Under OpenBoot 1 34

4. Packages
37
...Package Definitions, Package Instances, and Device Nodes 38
...Plug-in Device Drivers 38
...Package Methods 39
......Required Methods 39
......Recommended Methods 40
...Package Data Definitions 41
...Accessing Other Packages 42
...Debugging Packages 49
......Package Mappings 49
......nvramrc 49
......Modifying Package Properties 49
...Standard Support Packages 50
......Sun Disk-Label Support Package 50
......TFTP Booting Support Package 51
......Deblocker Support Package 52

5. Properties
55
...Standard FCode Properties 56
......Standard FCode Properties For Cards (General) 57
......Device-type Specific Properties For SBus Cards 57
......General Properties For Parent Nodes 57
......Properties For SBus Parent Nodes 57
...Standard Properties 58
...Manipulating Properties 72
......Property Creation and Modification 72
......Property Values 73
......Property Encoding 73
......Property Retrieval 73
......Property Decoding 74
...Property-Specific FCodes 75

6. Block and Byte Devices
77
...Block Devices 77
...Byte Devices 78
...Required Methods 78
...Required Properties 80
...Device Driver Examples 81
......Simple Block Device Driver 81
......Extended Block Device Driver 82
......Complete Block and Byte Device Driver 90

7. Display Devices
101
...Required Methods 101
...Required Properties 102
...Device Driver Examples 102
......Simple Display Device Driver 102
......Extended Display Device Driver 103
......Complete Display Device Driver 108

8. Hierarchical Devices
115
...Required Methods 115
...SBus Addressing 119
...SBus Required Properties 119
...VMEBus Addressing 120
...VMEBus Required Properties 120
...Device Driver Examples 120
......Basic Hierarchical Device Driver 121
......Extended Hierarchical Device Driver 124
......Complete Hierarchical Device Driver 132

9. Network Devices
149
...Required Methods 150
...Required Device Properties 151
...Optional Device Properties 151
...Device Driver Examples 152
......Simple Network Device Example 152
......Sample Driver With Test and Debugging Methods 154
......Bootable Network Device Driver Example 166

10. Serial Devices
193
...Required Methods 193
...Required Properties 194
...Device Driver Examples 194
......Simple Serial FCode Program 194
......Extended Serial FCode Program 195
......Complete Serial FCode Program 198

11. FCode Dictionary
203

A. FCode Reference
333
...FCode Primitives 333
...FCodes by Function 334
...FCodes by Byte Value 354
...FCodes by Name 366
...Version 2 FCodes 378

B. OpenBoot Interrupt Testing
381

C. FCode Memory Allocation
387
...For OpenBoot 2 387
...For OpenBoot 1 388

D. Changes in FCode Usage for OpenBoot 1
389
...FCode For OpenBoot 1 Systems 389
......FCode Programming Style 1 390
......FCode Programming Style 2 390
......FCode Programming Style 3 391
...Other OpenBoot 1 Restrictions 391
......Total FCode Program Size 391
......Old-style Memory Mapping And Unmapping 392
......Memory Mapping Size Limits 392
......Large General-purpose Mappings 392
......Memory De-allocation 393
......Total Properties 393
......Interpretation of my-address and my-space 393
......my-address Volatility 393
......free-virtual and Properties 393
......Changes in new-device and finish-device Usage 394

Index
395