{"action":"created","comment":{"url":"https://api.github.com/repos/NunyaOS/Nunya/pulls/comments/51069761","id":51069761,"diff_hunk":"@@ -109,3 +116,196 @@ void memory_free_page(void *pageaddr) {\n     freemap[cellnumber] |= cellmask;\n     pages_free++;\n }\n+\n+struct kmalloc_page_info * kmalloc_create_page_info(unsigned paddr) {","path":"src/memory.c","position":32,"original_position":32,"commit_id":"baacbcbda819c284a4d1fb65d7ef3555a838c8d3","original_commit_id":"baacbcbda819c284a4d1fb65d7ef3555a838c8d3","user":{"login":"shuyangli","id":4718844,"avatar_url":"https://avatars.githubusercontent.com/u/4718844?v=3","gravatar_id":"","url":"https://api.github.com/users/shuyangli","html_url":"https://github.com/shuyangli","followers_url":"https://api.github.com/users/shuyangli/followers","following_url":"https://api.github.com/users/shuyangli/following{/other_user}","gists_url":"https://api.github.com/users/shuyangli/gists{/gist_id}","starred_url":"https://api.github.com/users/shuyangli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuyangli/subscriptions","organizations_url":"https://api.github.com/users/shuyangli/orgs","repos_url":"https://api.github.com/users/shuyangli/repos","events_url":"https://api.github.com/users/shuyangli/events{/privacy}","received_events_url":"https://api.github.com/users/shuyangli/received_events","type":"User","site_admin":false},"body":"style: please get rid of the space between `*` and `kmalloc_create_page_info`","created_at":"2016-01-27T23:48:03Z","updated_at":"2016-01-27T23:48:03Z","html_url":"https://github.com/NunyaOS/Nunya/pull/17#discussion_r51069761","pull_request_url":"https://api.github.com/repos/NunyaOS/Nunya/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/NunyaOS/Nunya/pulls/comments/51069761"},"html":{"href":"https://github.com/NunyaOS/Nunya/pull/17#discussion_r51069761"},"pull_request":{"href":"https://api.github.com/repos/NunyaOS/Nunya/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/NunyaOS/Nunya/pulls/17","id":57441600,"html_url":"https://github.com/NunyaOS/Nunya/pull/17","diff_url":"https://github.com/NunyaOS/Nunya/pull/17.diff","patch_url":"https://github.com/NunyaOS/Nunya/pull/17.patch","issue_url":"https://api.github.com/repos/NunyaOS/Nunya/issues/17","number":17,"state":"open","locked":false,"title":"Kmalloc and Kfree","user":{"login":"rboccabe","id":6101310,"avatar_url":"https://avatars.githubusercontent.com/u/6101310?v=3","gravatar_id":"","url":"https://api.github.com/users/rboccabe","html_url":"https://github.com/rboccabe","followers_url":"https://api.github.com/users/rboccabe/followers","following_url":"https://api.github.com/users/rboccabe/following{/other_user}","gists_url":"https://api.github.com/users/rboccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/rboccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rboccabe/subscriptions","organizations_url":"https://api.github.com/users/rboccabe/orgs","repos_url":"https://api.github.com/users/rboccabe/repos","events_url":"https://api.github.com/users/rboccabe/events{/privacy}","received_events_url":"https://api.github.com/users/rboccabe/received_events","type":"User","site_admin":false},"body":"kmalloc and kfree are now available for allocating memory in kernel mode and releasing previously allocated memory in kernel mode. This can be tested by using  the following lines before the while(1) loop in main:\r\n\r\n```\r\nvoid *ptr1 = kmalloc(26);\r\nvoid *ptr2 = kmalloc(13);\r\nvoid *ptr3 = kmalloc(35);\r\nkfree(ptr2);\r\nptr2 = kmalloc(4);\r\nvoid *ptr4 = kmalloc(39);\r\nvoid *ptr5 = kmalloc(2);\r\nconsole_printf(\"%d for 26 -> 32\\n%d for 4 -> 8\\n%d for 35 -> 40\\n%d for 39 -> 48\\n%d for 2 -> 8\\n\", (int)ptr1, (int)ptr2, (int)ptr3, (int)ptr4, (int)ptr5);\r\n```","created_at":"2016-01-27T23:39:57Z","updated_at":"2016-01-27T23:48:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e30e209e723713c7e206841238732b5bdd770e46","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NunyaOS/Nunya/pulls/17/commits","review_comments_url":"https://api.github.com/repos/NunyaOS/Nunya/pulls/17/comments","review_comment_url":"https://api.github.com/repos/NunyaOS/Nunya/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NunyaOS/Nunya/issues/17/comments","statuses_url":"https://api.github.com/repos/NunyaOS/Nunya/statuses/baacbcbda819c284a4d1fb65d7ef3555a838c8d3","head":{"label":"rboccabe:kmalloc","ref":"kmalloc","sha":"baacbcbda819c284a4d1fb65d7ef3555a838c8d3","user":{"login":"rboccabe","id":6101310,"avatar_url":"https://avatars.githubusercontent.com/u/6101310?v=3","gravatar_id":"","url":"https://api.github.com/users/rboccabe","html_url":"https://github.com/rboccabe","followers_url":"https://api.github.com/users/rboccabe/followers","following_url":"https://api.github.com/users/rboccabe/following{/other_user}","gists_url":"https://api.github.com/users/rboccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/rboccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rboccabe/subscriptions","organizations_url":"https://api.github.com/users/rboccabe/orgs","repos_url":"https://api.github.com/users/rboccabe/repos","events_url":"https://api.github.com/users/rboccabe/events{/privacy}","received_events_url":"https://api.github.com/users/rboccabe/received_events","type":"User","site_admin":false},"repo":{"id":49730935,"name":"Nunya","full_name":"rboccabe/Nunya","owner":{"login":"rboccabe","id":6101310,"avatar_url":"https://avatars.githubusercontent.com/u/6101310?v=3","gravatar_id":"","url":"https://api.github.com/users/rboccabe","html_url":"https://github.com/rboccabe","followers_url":"https://api.github.com/users/rboccabe/followers","following_url":"https://api.github.com/users/rboccabe/following{/other_user}","gists_url":"https://api.github.com/users/rboccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/rboccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rboccabe/subscriptions","organizations_url":"https://api.github.com/users/rboccabe/orgs","repos_url":"https://api.github.com/users/rboccabe/repos","events_url":"https://api.github.com/users/rboccabe/events{/privacy}","received_events_url":"https://api.github.com/users/rboccabe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rboccabe/Nunya","description":"","fork":true,"url":"https://api.github.com/repos/rboccabe/Nunya","forks_url":"https://api.github.com/repos/rboccabe/Nunya/forks","keys_url":"https://api.github.com/repos/rboccabe/Nunya/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rboccabe/Nunya/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rboccabe/Nunya/teams","hooks_url":"https://api.github.com/repos/rboccabe/Nunya/hooks","issue_events_url":"https://api.github.com/repos/rboccabe/Nunya/issues/events{/number}","events_url":"https://api.github.com/repos/rboccabe/Nunya/events","assignees_url":"https://api.github.com/repos/rboccabe/Nunya/assignees{/user}","branches_url":"https://api.github.com/repos/rboccabe/Nunya/branches{/branch}","tags_url":"https://api.github.com/repos/rboccabe/Nunya/tags","blobs_url":"https://api.github.com/repos/rboccabe/Nunya/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rboccabe/Nunya/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rboccabe/Nunya/git/refs{/sha}","trees_url":"https://api.github.com/repos/rboccabe/Nunya/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rboccabe/Nunya/statuses/{sha}","languages_url":"https://api.github.com/repos/rboccabe/Nunya/languages","stargazers_url":"https://api.github.com/repos/rboccabe/Nunya/stargazers","contributors_url":"https://api.github.com/repos/rboccabe/Nunya/contributors","subscribers_url":"https://api.github.com/repos/rboccabe/Nunya/subscribers","subscription_url":"https://api.github.com/repos/rboccabe/Nunya/subscription","commits_url":"https://api.github.com/repos/rboccabe/Nunya/commits{/sha}","git_commits_url":"https://api.github.com/repos/rboccabe/Nunya/git/commits{/sha}","comments_url":"https://api.github.com/repos/rboccabe/Nunya/comments{/number}","issue_comment_url":"https://api.github.com/repos/rboccabe/Nunya/issues/comments{/number}","contents_url":"https://api.github.com/repos/rboccabe/Nunya/contents/{+path}","compare_url":"https://api.github.com/repos/rboccabe/Nunya/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rboccabe/Nunya/merges","archive_url":"https://api.github.com/repos/rboccabe/Nunya/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rboccabe/Nunya/downloads","issues_url":"https://api.github.com/repos/rboccabe/Nunya/issues{/number}","pulls_url":"https://api.github.com/repos/rboccabe/Nunya/pulls{/number}","milestones_url":"https://api.github.com/repos/rboccabe/Nunya/milestones{/number}","notifications_url":"https://api.github.com/repos/rboccabe/Nunya/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rboccabe/Nunya/labels{/name}","releases_url":"https://api.github.com/repos/rboccabe/Nunya/releases{/id}","deployments_url":"https://api.github.com/repos/rboccabe/Nunya/deployments","created_at":"2016-01-15T16:31:26Z","updated_at":"2016-01-15T16:31:27Z","pushed_at":"2016-01-27T07:00:25Z","git_url":"git://github.com/rboccabe/Nunya.git","ssh_url":"git@github.com:rboccabe/Nunya.git","clone_url":"https://github.com/rboccabe/Nunya.git","svn_url":"https://github.com/rboccabe/Nunya","homepage":null,"size":2035,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NunyaOS:master","ref":"master","sha":"791607e769444e6623c528952fff1c9f5172494d","user":{"login":"NunyaOS","id":16707703,"avatar_url":"https://avatars.githubusercontent.com/u/16707703?v=3","gravatar_id":"","url":"https://api.github.com/users/NunyaOS","html_url":"https://github.com/NunyaOS","followers_url":"https://api.github.com/users/NunyaOS/followers","following_url":"https://api.github.com/users/NunyaOS/following{/other_user}","gists_url":"https://api.github.com/users/NunyaOS/gists{/gist_id}","starred_url":"https://api.github.com/users/NunyaOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NunyaOS/subscriptions","organizations_url":"https://api.github.com/users/NunyaOS/orgs","repos_url":"https://api.github.com/users/NunyaOS/repos","events_url":"https://api.github.com/users/NunyaOS/events{/privacy}","received_events_url":"https://api.github.com/users/NunyaOS/received_events","type":"Organization","site_admin":false},"repo":{"id":49665082,"name":"Nunya","full_name":"NunyaOS/Nunya","owner":{"login":"NunyaOS","id":16707703,"avatar_url":"https://avatars.githubusercontent.com/u/16707703?v=3","gravatar_id":"","url":"https://api.github.com/users/NunyaOS","html_url":"https://github.com/NunyaOS","followers_url":"https://api.github.com/users/NunyaOS/followers","following_url":"https://api.github.com/users/NunyaOS/following{/other_user}","gists_url":"https://api.github.com/users/NunyaOS/gists{/gist_id}","starred_url":"https://api.github.com/users/NunyaOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NunyaOS/subscriptions","organizations_url":"https://api.github.com/users/NunyaOS/orgs","repos_url":"https://api.github.com/users/NunyaOS/repos","events_url":"https://api.github.com/users/NunyaOS/events{/privacy}","received_events_url":"https://api.github.com/users/NunyaOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NunyaOS/Nunya","description":"","fork":false,"url":"https://api.github.com/repos/NunyaOS/Nunya","forks_url":"https://api.github.com/repos/NunyaOS/Nunya/forks","keys_url":"https://api.github.com/repos/NunyaOS/Nunya/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NunyaOS/Nunya/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NunyaOS/Nunya/teams","hooks_url":"https://api.github.com/repos/NunyaOS/Nunya/hooks","issue_events_url":"https://api.github.com/repos/NunyaOS/Nunya/issues/events{/number}","events_url":"https://api.github.com/repos/NunyaOS/Nunya/events","assignees_url":"https://api.github.com/repos/NunyaOS/Nunya/assignees{/user}","branches_url":"https://api.github.com/repos/NunyaOS/Nunya/branches{/branch}","tags_url":"https://api.github.com/repos/NunyaOS/Nunya/tags","blobs_url":"https://api.github.com/repos/NunyaOS/Nunya/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NunyaOS/Nunya/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NunyaOS/Nunya/git/refs{/sha}","trees_url":"https://api.github.com/repos/NunyaOS/Nunya/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NunyaOS/Nunya/statuses/{sha}","languages_url":"https://api.github.com/repos/NunyaOS/Nunya/languages","stargazers_url":"https://api.github.com/repos/NunyaOS/Nunya/stargazers","contributors_url":"https://api.github.com/repos/NunyaOS/Nunya/contributors","subscribers_url":"https://api.github.com/repos/NunyaOS/Nunya/subscribers","subscription_url":"https://api.github.com/repos/NunyaOS/Nunya/subscription","commits_url":"https://api.github.com/repos/NunyaOS/Nunya/commits{/sha}","git_commits_url":"https://api.github.com/repos/NunyaOS/Nunya/git/commits{/sha}","comments_url":"https://api.github.com/repos/NunyaOS/Nunya/comments{/number}","issue_comment_url":"https://api.github.com/repos/NunyaOS/Nunya/issues/comments{/number}","contents_url":"https://api.github.com/repos/NunyaOS/Nunya/contents/{+path}","compare_url":"https://api.github.com/repos/NunyaOS/Nunya/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NunyaOS/Nunya/merges","archive_url":"https://api.github.com/repos/NunyaOS/Nunya/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NunyaOS/Nunya/downloads","issues_url":"https://api.github.com/repos/NunyaOS/Nunya/issues{/number}","pulls_url":"https://api.github.com/repos/NunyaOS/Nunya/pulls{/number}","milestones_url":"https://api.github.com/repos/NunyaOS/Nunya/milestones{/number}","notifications_url":"https://api.github.com/repos/NunyaOS/Nunya/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NunyaOS/Nunya/labels{/name}","releases_url":"https://api.github.com/repos/NunyaOS/Nunya/releases{/id}","deployments_url":"https://api.github.com/repos/NunyaOS/Nunya/deployments","created_at":"2016-01-14T18:02:40Z","updated_at":"2016-01-24T17:57:56Z","pushed_at":"2016-01-27T23:39:57Z","git_url":"git://github.com/NunyaOS/Nunya.git","ssh_url":"git@github.com:NunyaOS/Nunya.git","clone_url":"https://github.com/NunyaOS/Nunya.git","svn_url":"https://github.com/NunyaOS/Nunya","homepage":"nunyaos.github.io","size":2032,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":4,"forks":6,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NunyaOS/Nunya/pulls/17"},"html":{"href":"https://github.com/NunyaOS/Nunya/pull/17"},"issue":{"href":"https://api.github.com/repos/NunyaOS/Nunya/issues/17"},"comments":{"href":"https://api.github.com/repos/NunyaOS/Nunya/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/NunyaOS/Nunya/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/NunyaOS/Nunya/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NunyaOS/Nunya/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/NunyaOS/Nunya/statuses/baacbcbda819c284a4d1fb65d7ef3555a838c8d3"}}}}