How ksh93/ksh works
Main Components
a. Core Shell Components:
• Command Parser/Lexer (src/cmd/ksh93/sh/lex.c, parse.c)
• Execution Engine (src/cmd/ksh93/sh/xec.c)
• Built-in Commands (src/cmd/ksh93/bltins/)
• Shell Editor (src/cmd/ksh93/edit/)
• Job Control System (src/cmd/ksh93/sh/jobs.c)
b. Supporting Libraries:
• libast (Core AST Library)
• libcmd (Command Implementation Library)
• libdll (Dynamic Loading Library)
• libsum (Checksum Library)
Architectural Patterns
• Modular design with clear separation between shell core and supporting libraries
• Plugin architecture for dynamic loading of commands
• Layered architecture from low-level system interfaces to high-level shell features
Component Relationships
Shell Core
• > Command Parser/Lexer
• > AST Builder
• > Execution Engine
• > Built-in Commands
• > External Commands
• > Job Control
• > Interactive Features
• > Line Editor
• > History Management
Supporting Libraries
• > libast
• > String Handling
• > I/O Streams (sfio)
• > System Abstractions
• > libcmd
• > libdll
• > libsum
Implementation Details to Highlight
• Relationship between the shell parser and execution engine
• How built-in commands integrate with the core
• Demonstrate the dynamic loading mechanism for extensions
• Interaction between the shell and system libraries