Misplaced Pages

Apple Pascal

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

Apple Pascal is an implementation of Pascal for the Apple II and Apple III computer series, based on UCSD Pascal . Just like other UCSD Pascal implementations, it ran on its own operating system ( Apple Pascal Operating System , a derivative of UCSD p-System with graphical extensions).

#68931

50-620: Originally released for the Apple II in August 1979, just after Apple DOS 3.2, Apple Pascal pioneered a number of features that would later be incorporated into DOS 3.3, as well as others that would not be seen again until the introduction of ProDOS . The Apple Pascal software package also included disk maintenance utilities, and an assembler meant to complement Apple's built-in "monitor" assembler. A FORTRAN compiler (written by Silicon Valley Software of Sunnyvale, California ) compiling to

100-520: A disk controller and booted from it when the system was powered up—earning it the name "Autostart ROM ". DOS 3.2.1 was then released in July 1979 with some minor bug fixes. Apple DOS 3.3 was released in 1980. It improves various functions of release 3.2 including a rewrite of the RWTS to make it faster, while allowing for large gains in available floppy disk storage. The newer P5A/P6A PROMs in

150-445: A DOS, his co-founder Steve Jobs decided to outsource the task. The company considered using Digital Research 's CP/M , but Wozniak sought an operating system that was easier to use. On 10 April 1978 Apple signed a $ 13,000 contract with Shepardson Microsystems to write a DOS and deliver it within 35 days. Apple provided detailed specifications, and early Apple employee Randy Wigginton worked closely with Shepardson's Paul Laughton as

200-417: A consistent environment necessary for running more complex programs at the user's discretion. This required programming the computer to run those programs automatically. Furthermore, as companies, universities, and marketers wanted to sell computers to laypeople with little technical knowledge, greater automation became necessary to allow a lay-user to easily run programs for practical purposes. This gave rise to

250-529: A file one at a time between a disk buffer and main memory, requiring more time and resulting in DOS constantly blowing revs when reading or writing files. Programs became available early on to format disks with modified sector interleaves; these disks give DOS more time between sectors to copy the data, ameliorating the problem. Later, programmers outside Apple rewrote the File Manager routines to avoid making

300-475: A file's structural integrity. There is also a CATALOG function, for listing files on the diskette, and an INIT function, which formats a disk for use with DOS, storing a copy of DOS on the first three tracks, and storing a startup program (usually called HELLO) that is auto-started when this disk is booted from. On top of the File Manager API, the main DOS routines are implemented which hook into

350-448: A kind of software that a user would not consciously run, and it led to software that a lay user wouldn't even know about. As originally used, firmware contrasted with hardware (the CPU itself) and software (normal instructions executing on a CPU). It was not composed of CPU machine instructions, but of lower-level microcode involved in the implementation of machine instructions. It existed on

400-409: A more complex device, firmware may provide relatively low-level control as well as hardware abstraction services to higher-level software such as an operating system . Firmware is found in a wide range of computing devices including personal computers , phones , home appliances , vehicles , computer peripherals and in many of the digital chips inside each of these larger systems. Firmware

450-720: A new high-level format that is suitable for devices of up to 32  MB ; this makes it suitable for hard disks from that era and 3.5-inch floppies . All the Apple computers from the II Plus onward can run both DOS 3.3 and ProDOS, the Plus requiring a "Language Card" memory expansion to use ProDOS; the e and later models have built-in Language Card hardware, and so can run ProDOS straight. ProDOS includes software to copy files from Apple DOS disks. However, many people who had no need for

500-441: A program from the provider, and will often allow the old firmware to be saved before upgrading so it can be reverted to if the process fails, or if the newer version performs worse. Free software replacements for vendor flashing tools have been developed, such as Flashrom . Sometimes, third parties develop an unofficial new or modified ("aftermarket") version of firmware to provide new features or to unlock hidden functionality; this

550-697: A series of very tiny programs, each of which carries the loading process forward a few steps before passing control to the next program in the chain. The original Apple II included BASIC interpreter in ROM known originally as Apple BASIC and later as Integer BASIC . Variables in this language can only handle integer numbers ranging from −32,768 to +32,767 ( 16-bit binary values); floating point numbers are not supported. Apple commissioned Microsoft to develop Applesoft BASIC , capable of handling floating-point numbers. Applesoft BASIC cannot run Integer BASIC programs, causing some users to resist upgrading to it. DOS 3.3

SECTION 10

#1732780020069

600-471: A track in two revolutions with proper interleaving . A sector of the spinning disk passes under the read/write head while the RWTS routine is decoding the just-read sector (or encoding the next one to be written), and if this missed sector is the next one needed, DOS needs to wait nearly an entire revolution of the disk for the sector to come around again. This is called "blowing a rev" and is a well-understood performance bottleneck in disk systems. To avoid this,

650-463: A utility to migrate Apple DOS 3.2 files and programs to version 3.3 disks. Apple never offered a utility to copy in the other direction. To migrate Apple DOS 3.3 files back to version 3.2 disks, someone wrote a "NIFFUM" utility. There are also commercial utilities (such as Copy II Plus ) that can copy files between either format (and eventually ProDOS as well). Release 3.3 also improves the ability to switch between Integer BASIC and Applesoft BASIC, if

700-661: Is a major threat to system security: "Your biggest mistake is to assume that the NSA is the only institution abusing this position of trust – in fact, it's reasonable to assume that all firmware is a cesspool of insecurity, courtesy of incompetence of the highest degree from manufacturers, and competence of the highest degree from a very wide range of such agencies". As a potential solution to this problem, he has called for declarative firmware, which would describe "hardware linkage and dependencies" and "should not include executable code ". Firmware should be open-source so that

750-434: Is less frequently updated, even when flash memory (rather than ROM, EEPROM) storage is used for the firmware. Most computer peripherals are themselves special-purpose computers. Devices such as printers, scanners, webcams, and USB flash drives have internally-stored firmware; some devices may also permit field upgrading of their firmware. For modern simpler devices, such as USB keyboards , USB mouses and USB sound cards ,

800-471: Is referred to as custom firmware . An example is Rockbox as a firmware replacement for portable media players . There are many homebrew projects for various devices, which often unlock general-purpose computing functionality in previously limited devices (e.g., running Doom on iPods ). Firmware hacks usually take advantage of the firmware update facility on many devices to install or run themselves. Some, however, must resort to exploits to run, because

850-494: Is stored in non-volatile memory – either read-only memory (ROM) or programmable memory such as EPROM , EEPROM , or flash . Changing a device's firmware stored in ROM requires physically replacing the memory chip – although some chips are not designed to be removed after manufacture. Programmable firmware memory can be reprogrammed via a procedure sometimes called flashing . Common reasons for changing firmware include fixing bugs and adding features . Ascher Opler used

900-472: The Apple II computers from late 1978 through early 1983. It was superseded by ProDOS in 1983. Apple DOS has three major releases: DOS 3.1, DOS 3.2, and DOS 3.3; each one of these three releases was followed by a second, minor "bug-fix" release, but only in the case of Apple DOS 3.2 did that minor release receive its own version number, Apple DOS 3.2.1. The best-known and most-used version is Apple DOS 3.3 in

950-501: The Apple II debuted, the original Apple DOS source code was released by the Computer History Museum on its website. It was donated by the original author, Paul Laughton. Firmware In computing , firmware is software that provides low-level control of computing device hardware . For a relatively simple device, firmware may perform all control, monitoring and data manipulation functionality. For

1000-572: The "S" type as data files. A call vector table in the region of $ 03D0–03FF 16 allows programs to find DOS wherever it is loaded in the system memory. For example, if the DOS hooked into the BASIC CLI stops functioning, it can be reinitialized by calling location $ 03D0 16 (976 10 ) – hence the traditional 3D0G ("3D0 go") command to return to BASIC from the System Monitor . The process of loading Apple DOS involves

1050-520: The 1980 and 1983 releases. Prior to the release of Apple DOS 3.1, Apple users had to rely on audio cassette tapes for data storage and retrieval. When Apple Computer introduced the Apple II in April 1977, the new computer had no disk drive or disk operating system (DOS). Although Apple co-founder Steve Wozniak designed the Disk II controller late that year, and believed that he could have written

SECTION 20

#1732780020069

1100-572: The Equation Group in at least 42 countries. Mark Shuttleworth , the founder of the company Canonical , which created the Ubuntu Linux distribution, has described proprietary firmware as a security risk, saying that "firmware on your device is the NSA 's best friend" and calling firmware "a trojan horse of monumental proportions". He has asserted that low-quality, closed source firmware

1150-716: The GUI or even the battery life. Smartphones have a firmware over the air upgrade capability for adding new features and patching security issues. Since 1996, most automobiles have employed an on-board computer and various sensors to detect mechanical problems. As of 2010 , modern vehicles also employ computer-controlled anti-lock braking systems (ABS) and computer-operated transmission control units (TCUs). The driver can also get in-dash information while driving in this manner, such as real-time fuel economy and tire pressure readings. Local dealers can update most vehicle firmware. Other firmware applications include: Flashing involves

1200-400: The boundary between hardware and software; thus the name firmware . Over time, popular usage extended the word firmware to denote any computer program that is tightly linked to hardware, including BIOS on PCs, boot firmware on smartphones, computer peripherals , or the control systems on simple consumer electronic devices such as microwave ovens , remote controls . In some respects,

1250-605: The code can be checked and verified. Custom firmware hacks have also focused on injecting malware into devices such as smartphones or USB devices . One such smartphone injection was demonstrated on the Symbian OS at MalCon , a hacker convention . A USB device firmware hack called BadUSB was presented at the Black Hat USA 2014 conference, demonstrating how a USB flash drive microcontroller can be reprogrammed to spoof various other device types to take control of

1300-410: The computer has a language card ( RAM expansion) or firmware card. Apple DOS 3.1 disks use 13 sectors of data per track, each sector being 256 bytes . It uses 35 tracks per disk side, and can access only one side of the floppy disk, unless the user flipped the disk over . This gives the user a total storage capacity of 113.75 KB per side, of which about 10 KB are used to store DOS itself and

1350-523: The disk controller enable the reading and writing of data at a higher density, so 16 sectors (4 KiB) can be stored per track instead of 13 sectors (3.25  KiB ), increasing capacity from 113.75 KB to 140 KB per side – 16 KB of which is used by filesystem overhead and a copy of DOS, leaving 124 KB for user programs and data. DOS 3.3 is, however, not backward compatible ; it cannot read or write DOS 3.2 disks. To address this problem, Apple Computer released "MUFFIN",

1400-481: The disk directory, leaving about 100 KB for user programs. The first layer of the operating system is called RWTS, which stands for "read/write track sector". This layer consists of subroutines for track seeking, sector reading and writing, and disk formatting. An API called the File Manager was built on top of this, and implements functions to open, close, read, write, delete, lock (i.e. write-protect ), unlock (i.e. write-enable), and rename files, and to verify

1450-572: The disk. Apple Pascal attempted to rectify this by saving only to consecutive blocks on the disk. Other innovations introduced in the file system included the introduction of a timestamp feature. Previously only a file's name, basic type, and size would be shown. Disks could also be named for the first time. Limitations of the p-System included new restrictions on the naming of files. Writing files only on consecutive blocks also created problems, because over time free space tended to become too fragmented to store new files. A utility called KRUNCH

1500-628: The drive is formatted or wiped. Although the Kaspersky Lab report did not explicitly claim that this group is part of the United States National Security Agency (NSA), evidence obtained from the code of various Equation Group software suggests that they are part of the NSA. Researchers from the Kaspersky Lab categorized the undertakings by Equation Group as the most advanced hacking operation ever uncovered, also documenting around 500 infections caused by

1550-607: The extra copy for most sectors of a file; RWTS was instructed to read or write sectors directly to or from main memory rather than from a disk buffer whenever a full sector was to be transferred. An early patch to provide this functionality was published in Call-A.P.P.L.E. . Speedups in the LOAD command of three to five times were typical. This functionality soon appeared in commercial products, such as Pronto-DOS, Diversi-DOS, Hyper-DOS, and David-DOS, along with additional features, but it

Apple Pascal - Misplaced Pages Continue

1600-442: The free sector map, which was restricted to part of a single sector) is such that it is not possible to have more than 400 KB available at a time per drive without a major rewrite of almost all sections of the code; this is the main reason Apple abandoned this iteration of DOS in 1983, when Apple DOS was entirely replaced by ProDOS . ProDOS retains the 16-sector low-level format of DOS 3.3 for 5.25 inch disks, but introduces

1650-506: The ill-fated Apple III computer and its SOS operating system. Two more versions of Apple DOS, both still called DOS 3.3 but with some bug fixes and better support for the new Apple IIe model, were released in early and mid-1983. Without third-party patches , Apple DOS can only read floppy disks running in a 5.25-inch Disk II drive and cannot access any other media, such as hard disk drives, virtual RAM drives, or 3.5-inch floppy disk drives. The structure of Apple DOS disks (particularly

1700-430: The improvements of ProDOS (and who did not like its much higher memory footprint ) continued using Apple DOS or one of its clones long after 1983. The Apple convention of storing a bootable OS on every single floppy disk means that commercial software can be used no matter what OS the user owns. A program called DOS.MASTER enables users to have multiple virtual DOS 3.3 partitions on a larger ProDOS volume, which allows

1750-424: The latter wrote the operating system with punched cards and a minicomputer . There was no Apple DOS 1 or 2. Versions 0.1 through 2.8 were serially enumerated revisions during development, which might as well have been called builds 1 through 28. Apple DOS 3.0, a renamed issue of version 2.8, was never publicly released due to bugs. Apple published no official documentation until release 3.2. Apple DOS 3.1

1800-740: The machine's BASIC interpreter and intercept all disk commands. It provides BLOAD , BSAVE , and BRUN for storing, loading, and running binary executables . LOAD , RUN , and SAVE are provided for BASIC programs, and an EXEC was provided for running text-based batch files consisting of BASIC and DOS commands. Finally, four types of files exist, identified by letters in a catalog listing: There are four additional file types; "R", "S", and an additional "A" and "B", none of which are fully supported. DOS recognizes these types for catalog listings only, and there are no direct ways to manipulate these types of files. The "R" type found some use for relocatable binary executable files. A few programs support

1850-446: The manufacturer has attempted to lock the hardware to stop it from running unlicensed code . Most firmware hacks are free software . The Moscow-based Kaspersky Lab discovered that a group of developers it refers to as the " Equation Group " has developed hard disk drive firmware modifications for various drive models, containing a trojan horse that allows data to be stored on the drive in locations that will not be erased even if

1900-467: The overwriting of existing firmware or data, contained in EEPROM or flash memory module present in an electronic device, with new data. This can be done to upgrade a device or to change the provider of a service associated with the function of the device, such as changing from one mobile phone service provider to another or installing a new operating system. If firmware is upgradable, it is often done via

1950-545: The same p-code as Pascal was also available. Apple Pascal Operating System introduced a new disk format. Instead of dividing the disk into 256-byte sectors as in DOS 3.2, Apple Pascal divides it into "blocks" of 512 bytes each. The p-System also introduced a different method for saving and retrieving files. Under Apple DOS, files were saved to any available sector that the OS could find, regardless of location. Over time, this could lead to file system fragmentation , slowing access to

2000-464: The same amount of memory as the one that had created them. MASTER CREATE includes a self-relocating version of DOS that boots on Apples with any memory configuration. Apple DOS 3.2 was released in 1979 to reflect changes in computer booting methods that were built into the successor of the Apple II, the Apple II Plus. New firmware included an auto-start feature which automatically found

2050-426: The same track. However, the sector 0 actually needed in most cases will be on the next-higher track, and that track can be arranged relative to the last one to allow the needed time to decode the just-read sector and move the head before sector 0 comes around. On average, a full track can be read in two revolutions of the disk. The early DOS File Manager subverted this efficiency by copying bytes read from or written to

Apple Pascal - Misplaced Pages Continue

2100-461: The sectors on a DOS disk are arranged in an interleaved order: Later, ProDOS arranged the sectors in this order: When reading and decoding sector 0, then sector 8 passes by, so that sector 1, the next sector likely to be needed, will be available without waiting. When reading sector 7, two unneeded sectors, f and 0, pass by before sector 8 is available, and when reading sector 15, the drive will always have to wait an extra revolution for sector 0 on

2150-592: The term firmware in a 1967 Datamation article, as an intermediary term between "hardware" and "software". Opler projected that fourth-generation computer systems would have a writable control store (a small specialized high-speed memory) into which microcode firmware would be loaded. Many software functions would be moved to microcode, and instruction sets could be customized, with different firmware loaded for different instruction sets. As computers began to increase in complexity, it became clear that various programs needed to first be initiated and run to provide

2200-444: The trend is to store the firmware in on-chip memory in the device's microcontroller , as opposed to storing it in a separate EEPROM chip. Examples of computer firmware include: Consumer appliances like gaming consoles , digital cameras and portable music players support firmware upgrades. Some companies use firmware updates to add new playable file formats ( codecs ). Other features that may change with firmware updates include

2250-433: The use of many floppy-based DOS programs with a hard disk. Shortly after ProDOS came out, Apple withdrew permission from third parties to redistribute DOS 3.3, but granted one company, Syndicomm, an exclusive license to resell DOS 3.3. Commercial games usually did not use Apple DOS, instead having their own custom disk routines for copy protection purposes as well as for performance. DOS's RWTS routine can read or write

2300-502: The various firmware components are as important as the operating system in a working computer. However, unlike most modern operating systems, firmware rarely has a well-evolved automatic mechanism of updating itself to fix any functionality issues detected after shipping the unit. A computer's firmware may be manually updated by a user via a small utility program. In contrast, firmware in mass storage devices (hard-disk drives, optical disc drives, flash memory storage e.g. solid state drive)

2350-472: Was included in the package to consolidate free space. The biggest problem with the Apple Pascal system was that it was too big to fit on one floppy disk. This meant that on a system with only one floppy disk drive, frequent disk swapping was needed. A system needed at least two disk drives in order to use the operating system properly. Apple DOS Apple DOS is the disk operating system for

2400-416: Was never used in an official Apple DOS release. Similar functionality was, however, employed by Apple's successor operating system, ProDOS. The Apple IIGS -specific operating system GS/OS would eventually employ an even more efficient "scatter read" technique that would read any sector that happened to be passing under the read head if it was needed for the file being read. In 2013, more than 35 years after

2450-520: Was publicly released in June 1978, slightly more than one year after the Apple II was introduced, becoming the first disk-based operating system for any Apple computer. A bug-fix release came later, addressing a problem by means of its MASTER CREATE utility, which was used to create Apple DOS master (bootable) disks: The built-in INIT command created disks that could be booted only on machines with at least

2500-432: Was released when Applesoft BASIC was standard in ROM on the Apple II Plus, so Apple designed it to support switching back and forth between the two BASIC interpreters. Integer BASIC is loaded into RAM on the language card of Apple IIs (if present) and by typing FP or INT from BASIC, the user can switch between either version. After 1980, Apple DOS entered into a state of stagnation as Apple concentrated its efforts on

#68931