Register / Log in
29
March

Kermit

Written by Davee. 19 comments Posted in: Uncategorized

Turns out he’s not just a green frog! So, I’ve been throwing this word around recently and it’s probably about time I explain. Kermit, either a protocol or perhaps a funny name (see KIRK/SPOCK) is a communication interface for the PSP emu. Specifically it allows the PSP to talk to the host.

Now, I can tell there aren’t as many developers here, so I’ll try to simplify for the curious minds but this stuff is pretty complicated. I’ll only explain the API in detail as the lower level still need a little bit of clearing up, but here goes. 

Ok, Kermit is here so that the emu can communicate to the host to share resources and other vitality. Perhaps the primary reason is that of hardware; the PSP emu is excluded from many hardware devices. So kermit sets in and allows the system to talk to the vita in order to use the hardware. Blabbering aside, this is the hardware that kermit seems to be responsible for:

Interestingly, the kermit communication isn’t used for headphone remote or controller inputs.

In order to understand how kermit functions, it’s important to explore the usage of the API. Starting with the power house tool:

int sceKermit_driver_4F75AA05(KermitPacket *packet, u32 cmd_mode, u32 cmd, u32 argc, u32 allow_callback, u64 *resp)

This function is the send command function. It accepts a kermit packet initialised to minimum 64 bytes (no args need to be filled) a command mode which describes the set of commands, cmd: the actual command; the number of args following the 16 byte packet header. It also allows you to pass a boolean value to allow callbacks when waiting for completion and a 64 bit response.

What is important to note is that the packet arguements are 64-bit wide (not 32) and little endian encoded. There is a maximum of 13 arguements that can be passed to the host.

Sometimes, it is needed to send more than the 13 arguements worth of data. This is where kermit provides an API for memory. Shown below:

void sceKermitMemory_driver_AAF047AC(KermitPacket *packet, u32 argc, u8 *buffer, u32 buffer_size, u32 io_mode);
void sceKermitMemory_driver_80E1240A(u8 *data, u32 len);
void sceKermitMemory_driver_90B662D0(u8 *data, u32 data_size);

These function provide the fundamentals for data transmission to the host. sceKermitMemory_driver_AAF047AC is the staple command. It accepts a packet BEFORE transmission to host with the amount of args, a pointer to the input/output buffer and an indicator for the mode. This allows kermit to recieve the buffer of data when it processes the command, or have a place to output the data.

sceKermitMemory_driver_80E1240A and sceKermitMemory_driver_90B662D0 are the opposites of each other, providing input and output respectfully. This API is incredibly simple and is used to send multiple buffers to kermit prior and following a command.

These are pretty crap descriptions, but as you can see it’s a very command and transfer sort of interface. You tell it you have data you want to give it, you signal it and then it tells you where it’s put it.

https://github.com/DaveeFTW/vita_kermit

There is some source code describing in more codey ways. Also there are small reverses of functions used in the kermit. As you can see it works on a sort of circular queue of semaphores in the core. Have a “peek”.

Thanks to Proxima + some1

19 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Rafael707

    good work Davee, nice read on sceKermit, wish you much success :D

    Thu 29th March, 2012 at 02:31 BST
  2. rik

    Thanks for this. Kermit has a face now. Way over my head. Keep up the good work.

    Thu 29th March, 2012 at 02:47 BST
  3. TrE

    Hits “Like” Button

    Thu 29th March, 2012 at 04:22 BST
  4. TrE

    Oh yeah, Just wanted to say that this is awesome and it blows my mind that someone your age is this knowledgeable.

    There are good and bad people in every Country, Race, and Scene.

    It is always easier to remember bad things that happen then it is to remember the good stuff. I am hoping you don’t see the majority of the scene as bad.

    Keep up the good work!

    Thu 29th March, 2012 at 04:38 BST
  5. SAINTS

    good work !! keep on it

    Thu 29th March, 2012 at 10:55 BST
  6. UE

    The majority of the “Scene” is bad, I say scene in quotes as well we all know what that composes mainly of.

    Other than that good work -sighs- this device is proving rather troublesome but fun to work with on my end and it is good to see others are having some form of success in certain places too.

    I just wish sony would do the right thing and release a limited but not too limited SDK, I would rather create applications for the console than look into hacking the console but oh well

    Thu 29th March, 2012 at 17:20 BST
  7. PsDev

    Nice it seems in a couple instances that the data read byte by byte. Also the PSP emu is prevented from accessing most hardware because of sony adding the limitations and preventing exploits on the PSP side, of course kernal land would have to communicate so NICE JOB.

    Thu 29th March, 2012 at 23:46 BST
  8. LovePSPV

    great,Nice job

    Fri 30th March, 2012 at 04:28 BST
  9. sergio

    Good work dave!!!

    Fri 30th March, 2012 at 17:27 BST
  10. wololo

    Hey Davee, in kermit.c, function sceKermit_driver_4F75AA05 , on line 102 (https://github.com/DaveeFTW/vita_kermit/blob/master/kermit.c#L102), where does the variable packet come from?

    Mon 2nd April, 2012 at 13:50 BST
  11. Davee

    Oops. It’s a pointer to the data passed in arguement 1.

    Mon 2nd April, 2012 at 14:06 BST
  12. 2die4

    good luck mate hope to see your work in the wild soon

    Wed 4th April, 2012 at 12:53 BST
  13. Osirus

    this has got to be the best news i think with the argument in 210
    https://github.com/DaveeFTW/vita_kermit/blob/master/kermit.c#L_210 you should look in 1.65 ofw you might be happy :)

    Wed 4th April, 2012 at 22:29 BST
  14. Osirus

    SORRY 165

    Wed 4th April, 2012 at 22:30 BST
  15. iPIRATEthingsCUZamaPOOR

    Can’t wait!

    Fri 6th April, 2012 at 21:07 BST
  16. cloud

    I always have a look at blog.
    It is Japanese cloud.
    Always thank you for important information.
    I ask. Please release PSP vita PSP HEN.
    I am glad if I have you tell the release time.

    Sat 7th April, 2012 at 15:31 BST
  17. Halo Freak

    Fantastic, Davee. I’m definitely going to be watching your blog closely to see how the Vita hacking is going. Can’t wait to have a release date for PSV HEN (hopefully soon! xD)

    Sun 8th April, 2012 at 04:09 BST
  18. Dr_House78

    very impressive.
    Sorry dev, but how can do it?
    how can i do, i’m a mortal guy, to watch the call function of that fuc…ed Kermit?how you reach?…too far for me
    …IMPRESSIVE

    Tue 21st August, 2012 at 21:53 BST
  19. http://pacmanadvanced.com/Free-pacman-game/

    The best way to score points is to clear multiple lines with one block placement.
    Have you created a situation where you have one foot out the door, just in case things don’t work out. The music can be catchy, and they range from an 80s-style tune for Mickey’s Lab to a suspenseful final battle them for
    Pete. If the blocks reach the top of the
    screen, then the game will be over. It is divided in two-dimensional and three-dimensional intelligence.

    Wed 10th April, 2013 at 04:45 BST

Some HTML is OK

or, reply to this post via trackback.