Switch to full style
In-depth technology research: finding new ways to recover data, accessing firmware, writing programs, reading bits off the platter, recovering data from dust.

Forum rules

Please do not post questions about data recovery cases here (use this forum instead). This forum is for topics on finding new ways to recover data. Accessing firmware, writing programs, reading bits off the platter, recovering data from dust...
Post a reply

Samsung terminal commands

November 24th, 2013, 9:02

Hello everybody,

I'm just building up a list of common terminal commands available across all Samsung [SpinPoint] hard drives, together with their meaning or usage. I don't know the meaning of them all, so if you feel you can help a bit with some of them, please post them and I'll add them to the list!

Note that not all the commands will be available for all Samsung drives on market. Note also that some commands will only be available from a specific terminal level (ENG>, BOOT>, DBG>, SRV>).

Cheers

Re: Samsung terminal commands

November 24th, 2013, 9:43

****************
* ENG> COMMANDS *
****************

HE -> Show a list of available commands.
BT -> Enter BOOT> level (for downloading ROM, etc.).
ESC KEY -> Go to debug (DBG>) mode.
RT -> Software Reset.
D start [size = 8] -> Read size words or bytes (depending on model) from RAM beginning from word/byte start and output them.
DP start [size = 8] -> Read size words from ROM beginning from word start and output them in Big Endian (ROM dump flips every two bytes, so natural byte order seems to be the one output with this command). Working on old models.
DB start [size = 8] -> Read size bytes from RAM beginning from byte start and output them.
DW start [size = 8] -> Read size words from RAM beginning from word start and output them.
DF start [size = 8] -> Read size words from ROM beginning from word start and output them. Working on old models.
M start [data...] -> Edit RAM from start word/byte. Anter ENTER, write N bytes in hex format (e.g., F8). Press ENTER to move forward to next byte/word if needed without changes to current byte/word. Input a full stop (.) followed by an ENTER to finish.
MD start [Wdata...] -> Edit RAM from start word/byte. Anter ENTER, write N bytes/words in hex format (e.g., F8). Press ENTER to move forward to next byte/word if needed without changes to current byte/word. Input a full stop (.) followed by an ENTER to finish.
MB start [Bdata...] -> Edit RAM from start byte. Anter ENTER, write N bytes in hex format (e.g., F8). Press ENTER to move forward to next byte if needed without changes to current byte/word. Input a full stop (.) followed by an ENTER to finish. Example: MB 0 A0 12 FF
MW start [Wdata...] -> Edit RAM from start word. Anter ENTER, write N words in hex format (e.g., F804). Press ENTER to move forward to next word if needed without changes to current word. Input a full stop (.) followed by an ENTER to finish.. Example: MB 0 A012 FFA0
FB start pattern size -> 'Fill Bytes', fill size words/bytes of RAM from start with pattern. Example: FB 0 CAFE 20
FW start pattern size -> 'Fill Words', fill size words of RAM from start with pattern.
LW start size [z...] -> Write size words fromstart into RAM. If z exists, input is in hex. If not, input is ASCII text. Ends when size is reached. Example: LW 0 3 [ENTER] Hello! [ends].
UW start size -> After hit ENTER and ^F, shows in ASCII text RAM from start to end.
RS x Hd y z w -> Read using Head Hd. The command might specify a C H S address, but haven't understood it correctly yet.
SK Hd Cyl [sector] -> Could be "Seek cylinder Cyl and set head Hd", but on newer model requires a third param. Outputs the time needed to complete in old models. Need to understand better.
SD -> Spin down.
SU -> Spin up.
RN -> I don't know what it does, but causes my test drive to sweep a quite loud tone 4 times, 10 seconds each.
RE -> Like RN, but sweeps once.

Re: Samsung terminal commands

November 24th, 2013, 10:12

*****************
* DEBUG DBG> LEVEL *
*****************
You can use DBG> level to debug program code. My test drive can be debugged while online, and it permits up to 3 software breakpoints.

GO -> Go back to ENG> level and exit debugging.
BD -> Show current breakpoints.
BS x -> Set a new breakpoint at x. Example: BS 92FA
BC x -> Clear breakpoints. If x==0, it clears all breakpoints. Otherwise, x has to be the program memory address you want to clear the breakpoint from.
R2 x -> Seems to be a "RETURN" instruction, but I have to go a bit deeper on this one. Goes back to ENG> on my tests.
DA [x] -> Show code program in assembly from x with mnemonics (awesome). My test drive uses OakDSPCore instructions and mnemonics.
DR [x] -> Show the contents of all current CPU registers, or just the x one.
MR x y -> Load CPU register x with y value.
TB x -> It seems to "Test Memory Block" X times, but must research a bit more.
SS -> While debugging, it can be used to step forward to the next instruction.
Last edited by deftrue on November 24th, 2013, 10:14, edited 1 time in total.

Re: Samsung terminal commands

November 24th, 2013, 10:12

Hi,
Interesting post, you can update with my little contribution:

viewtopic.php?f=1&t=26366

Coptere

Re: Samsung terminal commands

November 24th, 2013, 10:23

*************
* ERROR CODES *
*************
Here are some error codes I've figured out so far:

E:0001 -> Command not valid
E:0003 -> Different number of arguments required
E:0004 -> Command not permitted in this level
E:0005 -> Argument value not in valid range.



Thanks for your comments and help!

Re: Samsung terminal commands

November 24th, 2013, 19:30

*******************
* TEST COMMANDS (1) *
*******************


XT [x] -> Show table of available servo tests. If x is provided, it performs the test with ID x.

XL -> As per patent US 5969899 A from Samsung, this may be a way of measuring the Latch force in emergency parking operations (the patent, by the way, is an interesting article about how hard drives switch to take DC power from the yet spinning spindle when sudden losses of power occur). I don't think this is relevant for data recovery, but at least, it is for testing drive's health. My test drive outputs Ivcm(DAC) = 6064; Latch Force = 13087 [gf(*100)] and Ivcm(DAC) = 6097; Latch Force = 13143 [gf(*100)] in two consecutive tests.

XC -> Test spin current. My test drive outputs 403 mA and 406 mA in two consecutive tests.

Re: Samsung terminal commands

November 24th, 2013, 19:39

Thanks very much. Very interesting.

BTW, here is the patent in PDF format:
http://patentimages.storage.googleapis. ... 969899.pdf
Post a reply