OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:41 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Go Bare Bones tutorial contains outdated information.
PostPosted: Fri May 27, 2016 12:28 pm 
Offline

Joined: Fri May 27, 2016 7:41 am
Posts: 1
Hi,

while searching for information related to bare metal Go uses, I discovered the Go Bare Bones tutorial.

It contains incorrect information regarding pointer arithmetic in Go.

Quote:
# Go doesn't allow you to directly access memory or use pointers. A trick to get
# around this is to have a function that takes a 32bit value and returns it.
# Take a look at 'terminal.go' to see how we use this to access video memory.


Which is false, and there is actually another example which makes use of the way Go allows for pointer use

Code:
func terminalPutEntryAt(c byte, color uint8, x uint8, y uint8){
  index := y * VGA_WIDTH + x
  addr := (*uint16)(unsafe.Pointer(buffer + 2 * uintptr(index)))
  *addr = makeVGAEntry(c, color)
}


Taken from https://github.com/jjyr/bootgo/blob/master/kernel.go

So I would like to make the Wiki reflect the right way of using Go features.

What is the Wiki update process?


Top
 Profile  
 
 Post subject: Re: Go Bare Bones tutorial contains outdated information.
PostPosted: Fri May 27, 2016 12:44 pm 
Offline
Member
Member

Joined: Mon Feb 02, 2015 7:11 pm
Posts: 898
pjmlp wrote:
What is the Wiki update process?


You edit it.

_________________
https://github.com/kiznit/rainbow-os


Top
 Profile  
 
 Post subject: Re: Go Bare Bones tutorial contains outdated information.
PostPosted: Fri May 27, 2016 2:19 pm 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1074
The whole point of a wiki (like Wikipedia, for instance) is that anyone can edit it, and anyone else can change it back if your edit is wrong, in some way.

Your forum login and password should work on the Wiki site as well, if you have joined the Wiki group.

Details can be found here: viewtopic.php?f=8&t=677

_________________
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group