← All posts tagged Mac

OS Mac XNU, the Mac OS X kernel and it's core is based on the Mach micro kernel
and FreeBSD 5. The Mach layer is responsible for kernel threads,
processes, pre-emptive multitasking, message-passing, virtual memory
management and console i/o. Above the Mach layer is the BSD layer that
supplies the POSIX API, networking and filesystems amongst other things.
The XNU kernel also has an object oriented device driver framework known
as the I/O Kit.

© phrack, issue 0x42
Mac macOS программы под старые маки были вот такими:

{$X-, $0-} {turn off Lisa libraries}
{ The OSES clause brings in the units containing the Pascal interfaces. }
OSES {$0 Obj/MemTypes } MemTypes, {basic Memory Manager data types}
{$0 Obj/QuickDraw} QuickDraw, {interface to QuickDraw}
{$0 Obj/OSIntf } OSIntf, {interface to the Operating System}
{$0 Obj/Toollntf } Toollntf; {interface to the Toolbox}
CONST applelD = 128 {resource IDs/menu IDs for Apple, File, and Edit menus}
filelD = 129
editID = 130
appleM =1 ; {index for each menu in myMenus (array of menu handles)}
fileM = 2;
editM = 3;
menuCount = 3; {total number of menus}
windowID = 128; {resource ID for application's window}
undoCommand '= 1 {menu item numbers identifying commands in Edit menu}
cutCommand = 3
copyCommand = 4
pasteCommand = 5
clearCommand = 6
VAR myMenus: ARRAY[1..menuCpunt] OF MenuHandle; {array of handles to the menus}

{ Read menu descriptions from resource file into memory and store handles }
{ in myMenus array }
myMenus[appleM] := GetMenu(applelD) , {read Apple menu from resource file}
AddResMenu(myMenus[appleM],'DRVR'); {add desk accessory names to Apple menu}
myMenus[fileM] := GetMenu(filelD); {read File menu from resource file}
myMenus[editM] := GetMenu(editID); {read Edit menu from resource file}
FOR i:=l TO menuCount DO InsertMenu(myMenus[i],0); {install menus in menu bar }
DrawMenuBar; { and draw menu bar}
END; {of SetOpMenus}
ROCEDURE DoCommand (mResult: LONGINT); Execute command specified by mResult, the result of MenuSelect }
VAR theltem: INTEGER; {menu item number from mResult low-order word}
theMenu: INTEGER; {menu number from mResult high-order word}
name: Str255; {desk accessory name}
temp: INTEGER;
theltem := LoWord(mResult); {call Toolbox Utility routines to set }
theMenu := HiWord(mResult); { menu item number and menu number}
CASE theMenu OF {case on menu ID}
BEGIN {call Menu Manager to get desk accessory }
Getltem(myMenus[appleM],theltem,name) . { name, and call Desk Manager to open }
temp := OpenDeskAcc(name); { accessory (OpenDeskAcc result not used)
SetPort(myWindow); {call QuickDraw to restore application }
END; {of applelD} { window as grafPort to draw in (may have

да, паскакаль..