Sunday, November 27, 2011

Cyberpunk circa 2002

The Adventures of Pip Cracker

1.1.1 Assembler Life
Flying Trapeze
Pip leans forward in his block, trying to piece together the bits of manpage in front of him. When he picked them up, he thought he was getting a recipe for making a stream device driver, but after two hours of pattern recognition all he has is a bunch of troff commands and a data section which doesn’t connect to anything else. He is about to give up, and try fetching again with another manpath, when a slow heavy crunching starts, first in the far outer cylenders and then echoing throughout the slice.
“Lucio, wake up man, it’s a fucking defrag! Come on, we’ve got to get out of here.”
In the next block, Lucio stirs sleepily. For a sprite, the guy sleeps like a log. Or a narcoleptic. Or a dead man, if he doesn’t get a move on. It had been Lucio’s idea to go exploring in the varman, slipping out quietly for a few hours before anyone is awake, but with the defrag going on, they’ll be lucky to get back to home before dinner. Nanny will be pissed.
Pip grabs his kit and climbs out into the toxic air. Breathing through his respirator, he vaporizes the bits of his half assembled manpage and resets the block inode counter, covering his tracks, just in case. He locks the lid of his block and jumps across the void to get Lucio.
“Wake up Lucio. Grab your stuff. It’s a defrag. We’ve gotta catch a proc and ride it out.”
Varman, like all the other slices, is a vast warehouse of bit blocks arranged in a long spiral. Some slices have large, spacious blocks, but varman is one of the old-style slices, with barely room to turn around. Still, even the smallest blocks are a welcome respite from the toxic air of the warehouse with full life support systems, climate control and neatly stacked bit arrays. In the space between the tops of the blocks and the ceiling of the warehouse, spindle arms whirl in great circles. Attached to the bottom of the spindle arms are grappling hooks, which slide up and down the length of the arm to trace the spirals of the block layout.
In the distance, they see the one arm doing the defrag. Unlike the other arms, it swings very slowly, dropping its hook down into each block, opening the lid, and inspecting the contents. Most of the time it just restacks the bit arrays and puts the block away again, but if it finds any foreign material, like, for example, a naughty sprite out exploring, it pulverises the contents of the block, turns off the life support, and removes the hook from the top of the block, marking it as taboo for all time.
The spindle does a very thorough job, which, fortunately for Pip and Lucio, is correspondingly slow. Atop their abandoned havens, they stand with their fstick eyelets held high above their heads, waiting for one of the free spindles to swing by so that they can catch hold and ride it to another sector.
One, two three; they watch the spindles flying by, timing the seek speed and noting the orientation of the grappling hook. On the fourth pass, Pip nods to Lucio and bobs his fstick. “Steady, steady, NOW”.
The two sprites leap into the air, swinging their fsticks towards the dangling hook. Pip catches cleanly, but Lucio’s eyelet is too high, and clanks against the cable. Lucio kicks his legs, trying to levitate for another desperate second. Pip grabs the handle of Lucio’s fstick with one hand and yanks it downward while raising the hook with his other hand. Lucio’s dead weight yanks on Pip’s arm as the spindle swings away. Under the mechanical crunch of the equipment and the shrieks of his friend, Pip hears the soft click of Lucio’s eyelet catching on the grappling hook. The next instant, the pressure on Pip’s arm is gone and they are flying across the warehouse, with the sounds of the defrag fading into the distance.
As they approach the loading bus dock, they twist their fsticks loose and fly free, hitting the floor with a tuck and roll, and coming to rest against the front of an incoming queue of buffered ios. They unscramble themselves and move away from the door and the incoming stream of ios, telescoping down their fsticks and putting them back in their kit bags.
The loading bus dock is shaped like a wide corridor. The warehouse side of the corridor is completely open, and transfer arms move bits one at a time out to the receiving edge where they can be snagged by the spindle arms and delivered to their destination blocks. The opposite wall is a collection of channels, pneumatic conveyor cars which shuttle bits back and forth between the slice and kernelspace. Pip lies down on the dock floor, safely underneath the transfer arms, and watches the cars moving in and out of the channels.

Surfing
“Where do you want to go?”
“Let’s try surfing L2 cache.”
“It’s probably pretty dead right now.”
“That’s what you said last time, and it totally rocked.”
The last time they had been out in kernelspace had been an epic day. They were sitting in history class when the first tarball flew over. Mr. Hand, who despite being completely boring himself was totally keyed in to possible distractions, gave them both a sharp look, so they picked up their pencils again and tried to refocus on the grim dates and details of woah woah one. But by the time the seventh tarball came rushing across the sky woah woah one was a distant, surpressed memory, and after the twelveth tarball they were shimmying around in their seats like cats in heat, desperate for the bell to ring. When the bell finally, mercifully, did ring they rushed out of class, ditched their books, grabbed their wetsuits and headed for the beach.
As they scrambled down the path over the sea grapes a cluster of patches was coming down.
“Hurry up. It looks like a compete apt-get. Let’s go for L3.”
“I hate L3. The curl is really slow, and if you get caught in the eddy you could be there for the rest of the day. Let’s try L2.”
“The last time I was there I coredumped so bad.”
“Yeah, but the nurse wrote you a great excuse note for skipping assembly.”
Down at L2 it was already blowing three threads. They zipped up their wetsuits and headed out, pushing their boards. At the kiddie break they pulled up onto the rough board surface, nosing high over the whitecaps and paddling hard in the troughs. The flow was already pretty high, so the paging tide pulled them out quickly.
Out in the swell, Pip sat up on his board and surveyed the grey, heaving horizon. As far as he could see, the peaks were rolling in about 50 ns apart with a uniform break of 6-8 feet.
“They’re all keepers. Let’s go.”
Pip turned his board and climbed the back of a passing wave. He felt the wave start to grab him, and pulled back, to the edge of its reach, riding slowly forward to the edge of the coral shelf. As the wave picked up power, he turned and slid down into the trough, watching the break in front of him, rushing right to left, and counting beats as the wave behind him rolled forward. On five, he started paddling like a madman. At seven, he felt himself rising slightly, as the tip of the wave slid under the back of his board. At eight, the full strength of the wave reached him, and with a final, two armed pull he grabbed the edges of his board and raised up into his riding crouch, setting up crazy foot style, and leaned back slightly, turning the nose of his board down the length of the pipeline. The water spinning into the edge of the reef threw him forward. He swooshed down the face of the wave, piling gravity into the equation, and then turned back up, slowing as he approached the tip of the wave, and then turning again, rushing down again as the tip of the wave, still carrying the foam of his track, crashes into the shallows behind him.

Roller Coaster
“All right”, Pip answered. “Let’s give it a shot.”
Pip and Lucio crawl across the loading dock floor and climb onto the back of an outbound DMA transfer. Pip takes out his zip wand and compresses the block in front of him, so he and Lucio can squeeze on without causing a buffer overflow when they arrive in kernelspace. The transfer arms move a few additional blocks onto the train and then the train, feeling a full load, takes off.
The DMA transfer to kernelspace is a windy, twisty tube which rises, falls, coils and straights through a mass of other transfer routes and communications infrastructure. It was originally designed to handle the leisurely rhythms of sequential access tapes – hooking it up to modern storage devices is like driving an Indy car down a goat path. For normal blocks, it’s not too bad – if they haven’t repaved the road at least they pay a lot more attention to fastening the seat belts. But a sprite is not a normal block, and riding compressed is even worse – you have to keep yourself on the sled as well as the unwieldy deadweight directly in front of you, or be run over by the next train or zapped as a buffer underflow if you arrive without your cover block.
Pip holds on to the sled with one hand and uses the other to steady his block. He carefully watches the glowing track in front for advance notification of the next twist, adjusting his center of gravity as well as that of the block, and steeling his arms to deal with the g-forces to come.
The train starts with a straight, and then a hard right turn. After the turn they start rising in a tight spiral, corkscrewing counter-clockwise so tightly that the induced magnetic field causes Lucio’s hair to stand crazily on end. Pip just has time to point and laugh when the spiral ends and they start on a straight, steep descent. The sight lines in front fall away faster and faster as the descent gets steeper and steeper, until Pip has to operate on pure intuition. He closes his eyes for an instant and sees a loop loop down left. He opens his eyes to check, and is starting to yell the pattern to Lucio, when he sees that his friend is screaming like a lunatic and holding both hands in the air. As they enter the first loop, Pip closes his eyes again, this time not for intuition’s sake but so that he doesn’t have to see Lucio splattered against the tunnel wall.
Lucio must have gotten hold of his senses and his handles, because when Pip opens his eyes Lucio is still on his sled. The track slaloms through communication moghuls, left round right round right round left thud over thud over left right flat. Just as his arms are beginning to ache and tremble uncontrollably Pip sees a light ahead, the end of the ride, kernelspace.

1.1.2 Pursuit

Tracers
Pip and Lucio unzip their cover blocks and tumble out of their cars onto the buffer floor just ahead of the waiting bit verifier. Coming to a rolling stop, Pip realizes that the light was not the end of tunnel, it is the headlamp of an oncoming train.
When the last car in the input channel enters the buffer an alarm sounds and a spolight clicks on to illuminate the whole of the channel opening. As Pip and Lucio scramble towards sheltering darkness, they hear more alarms firing and an unbuffered stream of sensor readings flying towards an array of logwriters.
“Tracers!”
On a normal day, the DMA buffer is not a bad place to be. All of kernelspace is atmosphere conditioned, so they would have flipped off their respirators and sat back to enjoy the cool air. Unlike the creaky magnetic mechanics of the slice spindles, everything here is quiet and efficient, running silently on pneumatic beds of electric current. The buffer is huge, so if you move below the low-water mark there is plenty of time and opportunity to have a rest, take stock of your options, and plan your day. And if you just want to joyride, there is easy access to the IRQ port, which whisks you off to an awaiting runqueue with all the luxurious priority of a diplomatic motorcade.
Unfortunately, this is not a normal day. Things have changed, and, at least for our young sprites, not for the better. Someone is paying very close attention to the IO subsystem, receiving event notifications in real time as well as logging system calls for future reference. As a cracker, you survive by following two simple rules: don’t let anyone know you are there, and don’t let anyone find out that you ever have been there. Tracers up the ante on both fronts.
Pip moves farther back into the darkness and tries to figure out the mask on tracer events. Clearly, read is on, since they tripped that when they arrived. The logwriters seem to work without alarms, so write may be off, but more likely it is just bypassing the system calls and just using raw registers. As another DMA train arrives Pip swivels towards the IRQ port, just in time to see the darkness obscured by the ignition flash of a spotlight.
“Shit, they’re watching interrupts too. Kiss that runqueue goodbye.”
“Let’s just longjump out of here. This is crazy.”
Before Pip can respond, Lucio has his jump pointer out and is scanning for stored offsets. The dial stops at 0x00100000 and the display reads “_text”. Lucio nods to Pip and begins his jump.
“Lucio, wait, we haven’t recalibrated since…”
But his friend is already dissolving into the transport beam. Faced with the prospect of frying alone in the frying pan or frying together in the fire, Pip jumps into the unknown.

No comments: