4.7号是什么星座| 梦见石头是什么意思| 左手中指麻木是什么原因| 茄子炒什么好吃又简单| 做俯卧撑有什么好处| 心率90左右意味着什么| 百什么争鸣成语| 姜子牙姓什么| 脚气缺什么维生素| 为什么怀孕了还会来月经| 黄精是什么| 梦到头发白了是什么意思| mansory是什么车| 乳腺结节和乳腺增生有什么区别| 卡地亚属于什么档次| 激光是什么| 耳鸣有什么症状| 朱元璋属什么生肖| 减肥期间吃什么主食| 盗汗遗精是什么意思| 今天什么节日| 大将军衔相当于什么官| 九四年属什么| 为什么青霉素要做皮试| 结节是什么东西| 右侧卵巢囊性回声什么意思| 阴唇外翻是什么原因| 中位数是什么意思| 常务副县长是什么级别| 6.17什么星座| 去医院洗纹身挂什么科| omega什么意思| 刮宫和清宫有什么区别| 女性分泌物带血是什么原因| 猫头鹰吃什么| 象是什么结构| 手上的月牙代表什么意思| 人生观价值观世界观是什么意思| 女人性冷淡是什么原因| 蚊虫叮咬用什么药| 楼台是什么意思| 人生的意义到底是什么| 5月4日是什么星座| 县宣传部长是什么级别| 女人每天喝什么最养颜| 女人梦到火是什么预兆| 青梅煮酒什么意思| ca125是查什么的| 马太效应是什么意思| 插管意味着什么| 耐受性是什么意思| 豆沙馅可以做什么美食| 狮子座是什么象星座| 榴莲为什么臭| 妹汁是什么意思| 玫瑰花像什么| ne是什么意思| 火把节什么时候| 放射科检查什么| idc是什么意思| 脑囊肿是什么病严重吗| 为什么会闰月| 仔字五行属什么| 孕妇血糖高吃什么| 红丝带的含义是什么| 抽血生化是查什么| 王字旁的字跟什么有关| lv是什么意思| 百香果和什么搭配好喝| 为什么要拔智齿| 肌酸激酶偏低说明什么| 什么叫肾病综合征| 减肥吃什么水果好| 什么粉可以代替木薯粉| 教师节给老师送什么礼物| 上呼吸道感染吃什么| 慢什么斯什么| 农历11月25日是什么星座| 刍狗是什么意思| 侄女叫我什么| 小孩经常尿床是什么原因| 为什么会斑秃| 软骨瘤是什么病| 歆五行属什么| 牙疼吃什么好得快| 尿酸高是什么原因| 痞满是什么意思| 喝水牙疼是什么原因| 黄体回声是什么意思| 嘴角烂是什么原因| 可怜巴巴是什么意思| 水晶粉是什么原料做的| 全身瘙痒要警惕什么病| 自负什么意思| 白事的礼金叫什么| 珠海有什么特产| 点痣后需要注意什么事项| 肝火旺盛失眠吃什么药| 测智力去医院挂什么科| 子宫内膜9mm意味着什么| 退烧吃什么药好| 机不可失的下一句是什么| 浙江大学什么专业最好| 小孩个子矮小吃什么促进生长发育| 面基什么意思| cyl是什么意思| 性质是什么意思| 梦见白发是什么意思| 牛的三合和六个合生肖是什么| 子宫肌瘤挂什么科室| 越五行属性是什么| vlone是什么牌子| 灰指甲什么症状| 人为什么要吃饭| 欺世盗名是什么意思| 为什么会经常口腔溃疡| 小孩咳嗽吃什么药好| 太妃是皇上的什么人| 多吃丝瓜有什么好处和坏处| 小三阳有什么症状表现| 种马是什么意思| 撕漫男是什么意思| 吃什么水果对身体好| 右侧肋骨下面是什么器官| 韩红是什么军衔| 今年62岁属什么生肖| 打牛是什么意思| 为什么长痣越来越多了| 月经少吃什么好排血多| 颈椎反弓是什么意思| 葛根有什么作用| 试管进周期是什么意思| 白细胞酯酶弱阳性是什么意思| 脑供血不足吃什么中成药| 1987是什么年| 右耳朵热代表什么意思| coach是什么意思| 咳嗽是什么原因引起的| 什么人会得胆囊炎| 血脂高低看什么指标| 拔罐拔出水泡是什么原因| 宽宏大度是什么生肖| 游戏id是什么意思| 梦见一坨屎是什么意思| 加德纳菌阳性是什么意思| 心率慢是什么原因| 螳螂是什么生肖| 取痣用什么方法最好| 什么是双飞| 海豹油有什么作用| 气喘吁吁什么意思| 非分之想什么意思| 支原体感染是什么病| 范仲淹号什么| 上火了吃什么水果降火最快| 人做梦是什么原因| 羊蝎子是什么东西| 穷代表什么生肖| 唇系带断了有什么影响| 苏打水配什么好喝| 莱昂纳多为什么叫小李子| 腰封是什么意思| cst是什么意思| 尾椎骨痛挂什么科| 姐姐的儿子叫什么| 木字五行属什么| 纺锤形是什么形状| 睡莲和碗莲有什么区别| 平胸是什么原因导致的怎样解决| 蜜糖有什么功效和作用| 为什么肚子会隐隐作痛| 尿特别黄是什么原因| 挚爱适合用在什么人| 亚临床甲减是什么意思| 自然是什么意思| 陆陆续续是什么意思| 经常嘴苦是什么原因| 胃疼吃什么药好得最快最有效| 山楂什么时候成熟| 小孩耳鸣是什么原因引起的| 左耳长痣代表什么| 什么是形声字| 批准文号是什么| 什么情况下做喉镜| 今年什么时间进伏| 酸奶有什么营养价值| 元朝是什么民族| 漂发是什么意思| 口出狂言是什么生肖| 什么是甲沟炎图片| mt指什么| 吃什么有助于睡眠效果好| 鼻尖长痣代表什么| 凌五行属性是什么| 叶脉是什么| 举人相当于什么官| 脓疱疮是什么原因引起的| 幼小衔接班是什么意思| 癸水的根是什么| 西米露是什么| 淋巴细胞低是什么原因| aimer是什么意思| 什么虫子有毒| 哈伦裤配什么上衣| 格力空调睡眠模式1234什么意思| 西加一横读什么| 猿是什么动物| 浪凡算是什么档次的| 雀舌是什么茶| 什么东西清肺止咳| 一笑倾城是什么意思| 精是什么意思| 爱是什么词| 升结肠憩室是什么意思| 年轻人心悸是什么原因| 醉酒第二天吃什么才能缓解难受| airwalk是什么牌子| 伏特加是什么| 孩子上火了吃什么降火最快| 吃什么可以排出霉菌| 手机充电口叫什么| 放屁多是什么原因| 眼底出血是什么原因引起的| 何曾是什么意思| 组织液是什么| 打感情牌是什么意思| 真菌感染用什么药| 水清则无鱼什么意思| 迷走神经是什么| 骨结核吃什么药效果好| 紫苏有什么作用与功效| 眼睛疲劳用什么眼药水好| 九一八事变是什么意思| 与自己和解什么意思| 吃蒲公英有什么好处| amp是什么意思| 利可君片是治什么病| 什么时候敷面膜效果最好| 血月代表什么| 塬字五行属什么| 宫颈纳氏囊肿是什么意思| 扑炎痛又叫什么| 头晕脑胀吃什么药| 什么叫多重耐药菌| 早上九点到十点是什么时辰| 阿玛尼手表算什么档次| 腔隙灶是什么意思| 晚上10点属于什么时辰| 大吉是什么意思| 一什么新闻| 心慌气短胸闷吃什么药| 贲门ca是什么意思| 三伏天吃什么好| 肾怕什么| 大便黑色什么原因| 高密度脂蛋白胆固醇高是什么意思| 什么水果糖分低| 矫枉过正什么意思| 风热感冒吃什么药好| mlb是什么牌子| 来月经同房有什么影响| 华国锋为什么辞职| 腿胖是什么原因引起的| 参合是什么意思| 百度Jump to content

文苑萃英--浙江频道--人民网

From Wikipedia, the free encyclopedia
百度 【网民留言仅代表作者个人意见,不代表人民网观点】留言方式:

The Macintosh Toolbox implements many of the high-level features of the Classic Mac OS, including a set of application programming interfaces for software development on the platform. The Toolbox consists of a number of "managers," software components such as QuickDraw, responsible for drawing onscreen graphics, and the Menu Manager, which maintain data structures describing the menu bar. As the original Macintosh was designed without virtual memory or memory protection, it was important to classify code according to when it should be loaded into memory or kept on disk, and how it should be accessed. The Toolbox consists of subroutines essential enough to be permanently kept in memory and accessible by a two-byte machine instruction; however it excludes core "kernel" functionality such as memory management and the file system. Note that the Toolbox does not draw the menu onscreen: menus were designed to have a customizable appearance, so the drawing code was stored in a resource, which could be on a disk.

Advent and implementation

[edit]

On 68k systems

[edit]

The original Motorola 68000 family implementation of the Macintosh operating system executes system calls using that processor's illegal opcode exception handling mechanism. Motorola specified that instructions beginning with 1111 and 1010 would never be used in future 68000 family processors, thus freeing them for use as such by an operating system. Further, they each had their own dedicated interrupt vector, separate from the generic illegal opcode handler. As 1111 was reserved for use by co-processors such as the 68881 FPU, Apple chose 1010 (A in hexadecimal) as the prefix for operating system calls. Handling illegal instructions is known as trapping, so these special instructions were called A-traps.[1] When the processor encounters such an instruction, it transfers control to the operating system, which looks up the appropriate task and performs it. There were two advantages to this mechanism:

  • It results in compact programs. Only two bytes are taken by every operating system access, in contrast to four or six when using regular jump instructions.
  • The table used to look up the appropriate function is stored in RAM. Then, even if the underlying code was stored in ROM, it could still be overridden (patched) by replacing the ROM memory address with a RAM address.

The system was further optimized by allotting some bits of the A-trap instruction to store parameters to the most common functions. For example, memory allocation is a very common task, so it should be expressed in as few bytes of code as possible. Sometimes the programmer wants to clear the memory block to zeros, so either the allocation function should take a boolean parameter, or there should be two allocation functions. To pass a parameter would require an additional two-byte instruction, which would be inefficient. Having two functions would require at least an extra four bytes of RAM used for the address in the function look-up table. The most efficient solution is to map multiple A-traps to the same subroutine, which then uses the A-trap as a parameter. This is true of the most commonly used subroutines. However, the Toolbox was composed of the less commonly used subroutines. The Toolbox was defined as the set of subroutines which took no parameters within the A-trap, and were indexed from a 1024-entry, 4-kilobyte dispatch table.[2] (Machines shipped with less than one megabyte of RAM use a single table of 512 entries, which corresponds to the 256-entry OS dispatch table of later ROM revisions.[3])

On PowerPC systems

[edit]

In 1994, Apple released Macintoshes using the PowerPC architecture, which lacked hardware support for the A-trap mechanism available on 68k systems. Because of their use in applying software patches, however, the dispatch tables were retained. The API library code underlying any Toolbox routine then does nothing except reference the dispatch table. The dispatch table linked only to emulated 68000 family code. Toolbox functions implemented in native PowerPC code have to first disable the emulator using the Mixed Mode Manager. For the sake of uniformity and extensibility, new function entries even continued to be added to the Toolbox after the PowerPC transition.

An alternative mechanism did exist, however, in the Code Fragment Manager, which was used to load and dynamically link native PowerPC programs. The PowerPC system call facility, analogous to the A-trap mechanism, was used to interface with the Mac OS nanokernel, which offered few services directly useful to applications.

Functionality

[edit]

Programming interfaces

[edit]

The Toolbox is composed of commonly used functions, but not the most commonly used functions. As a result, it grew into a hodgepodge of different API libraries.[3] The Toolbox encompasses most of the basic functionality which distinguished the Classic Mac OS. Apple's references “Inside Macintosh: Macintosh Toolbox Essentials” and “Inside Macintosh: More Macintosh Toolbox”, similarly vague in scope, also document most of the Toolbox.

Use in booting

[edit]

Because much of the Toolbox is implemented in ROM, alongside the computer's firmware, it was convenient to use as a bootloader environment. In conjunction with resources stored on the ROM chip, the Toolbox can turn the screen gray, show a dialog box with the signature "Welcome to Macintosh" greeting, and display the mouse cursor. By using Toolbox to help boot the machine, a rudimentary Mac-like environment can be initialized before ever loading the System suitcase from disk (in fact before ROMs on NuBus cards were executed), which is when the decision to use 24-bit or 32-bit addressing has to be made. (System 7's support for 32-bit addressing requires 32-bit clean ROMs, as older Mac ROMs do not have support for this). The need for diagnostics as in the BIOS resident for IBM PC compatibles' boards is not necessary since the Macintosh has most of its diagnostics in POST and automatically reports errors via the "Sad Mac" codes.

The similarity between the boot-up environment and the actual operating system should not be confused with being identical, however. Although the "Classic Mac OS" boot process is convoluted and largely undocumented, it is not more limited than an IBM PC compatible BIOS. Like a PC's master boot record, a ROM-based Mac reads and executes code from the first blocks ("boot blocks") of the disk partition selected as the boot device. The boot blocks then verify that a suitable rudimentary environment exists, and use it to load the System suitcase. A different operating system with a different file system can boot by simply using its own code in the boot blocks.[4] This system was not used for PowerPC Linux, however, because Open Firmware in New World ROM machines requires a bootloader within an HFS filesystem—a reason having nothing to do with the Toolbox or "old-fashioned" Macs in general. More narrowly, the Startup Disk control panel in the Classic Mac OS and later macOS only allows the user to select a mounted filesystem with very particular constraints.

Legacy

[edit]

In Mac OS X, the Toolbox is not used at all, though the Classic Environment loads the Toolbox ROM file into its virtual machine. Much of the Toolbox was restructured and implemented as part of Apple's Carbon programming API, allowing programmers familiar with the Toolbox to port their program code more easily to Mac OS X.

See also

[edit]

References

[edit]
  1. ^ Apple Inc. (6 July 1996). "A-Line Instructions". Archived from the original on 2025-08-06. Alt URL
  2. ^ Apple Inc. (6 July 1996). "About the Trap Manager". Archived from the original on 2025-08-06. Alt URL
  3. ^ a b Olson, James H. (4 September 1997). "Mac Alamanac II". Linux/m68k for Macintosh.
  4. ^ Apple Inc. (6 July 1996). "Boot Blocks". Archived from the original on 2025-08-06. Alt URL
[edit]
肉质瘤是什么东西 nu11是什么意思 令人发指是什么意思 什么药不能喝酒 嘴角边长痘痘是什么原因
晦气是什么意思 脑鸣挂什么科 己卯日五行属什么 bj是什么 房性期前收缩是什么意思
什么是小针刀治疗 为什么会漏尿 籍贯是什么意思 朝鲜和韩国什么时候分开的 梦到水是什么意思
吃什么hcg翻倍快 心驰神往是什么意思 什么菜 甲状腺一般吃什么药 血管炎不能吃什么食物
节节草有什么功效clwhiglsz.com 什么大牌护肤品好用hcv8jop3ns8r.cn 羊水栓塞是什么原因引起的hcv9jop1ns8r.cn 测骨龄去医院挂什么科hcv9jop2ns9r.cn 低级别上皮内瘤变是什么意思hcv9jop0ns0r.cn
断生是什么意思啊hcv8jop3ns4r.cn 花甲是什么hcv9jop0ns5r.cn 驻外大使是什么级别wzqsfys.com 人老放屁是什么原因hcv9jop4ns0r.cn 吃瓜群众是什么意思hcv8jop4ns6r.cn
恶心想吐吃什么药好hcv8jop0ns0r.cn 吃什么食物补血hcv7jop9ns2r.cn 支气管炎性改变是什么意思hcv8jop1ns4r.cn 子宫脱落是什么原因引起的hcv8jop2ns6r.cn 给女生送礼物送什么好hcv8jop0ns6r.cn
甍是什么意思chuanglingweilai.com 5.16号是什么星座hcv8jop0ns5r.cn tf卡是什么hcv7jop4ns7r.cn 维生素a中毒是什么症状hcv9jop0ns2r.cn 什么什么深长wuhaiwuya.com
百度